update 允许打开窗口时传入参数,通过props.param接收

This commit is contained in:
2021-04-25 21:57:46 +08:00
parent 7e24830e49
commit ce92b15fe8
2 changed files with 10 additions and 13 deletions

View File

@@ -97,19 +97,15 @@ export default {
methods: {
/**
* 打开一个新的标签页
* 第一个参数可以是json
* settings: {
* title: String,
* path: String,
* icon: String,
* param: Object,
* closable: Boolean = true,
* }
*/
onOpenContentWindow(title, path, icon, closable = true) {
const settings =
typeof title === 'object'
? title
: {
title,
path,
icon,
closable,
};
onOpenContentWindow(settings) {
if (settings.path) {
const key = settings.key || getNewID();
@@ -134,6 +130,7 @@ export default {
title: settings.title || '新建窗口',
component: null,
path,
param: settings.param,
loaded: false,
});