@maxelms/create-plugin-cli 1.1.34 → 1.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +46 -49
- package/package.json +1 -1
- package/templates/angular-micro-app/webpack.config.js +2 -4
- package/templates/angular-micro-button/webpack.config.js +0 -2
- package/templates/angular-micro-field/webpack.config.js +1 -3
- package/templates/angular-micro-plugin/webpack.config.js +1 -3
- package/templates/react-micro-app/src/pages/Home/index.tsx +4 -16
- package/templates/react-micro-button/src/App.tsx +1 -0
- package/templates/react-micro-field/src/App.tsx.tpl +1 -9
- package/templates/react-micro-field/webpack.config.js.tpl +2 -5
- package/templates/react-micro-field-umi/config/plugin.ts +0 -3
- package/templates/react-micro-plugin/src/App.tsx.tpl +1 -10
- package/templates/react-micro-plugin/webpack.config.js.tpl +1 -3
- package/templates/react-micro-plugin-umi/config/plugin.ts +0 -3
- package/templates/vue-micro-button/vue.config.js.tpl +6 -3
- package/templates/vue-micro-field/vue.config.js.tpl +8 -4
- package/templates/vue-micro-plugin/vue.config.js.tpl +7 -3
- package/templates/vue3-micro-app/vue.config.js.tpl +1 -0
- package/templates/vue3-micro-button/src/App.vue.tpl +4 -2
- package/templates/vue3-micro-button/vue.config.js +8 -3
- package/templates/vue3-micro-field/src/App.vue.tpl +4 -2
- package/templates/vue3-micro-field/vue.config.js +7 -3
- package/templates/vue3-micro-plugin/src/App.vue.tpl +9 -2
- package/templates/vue3-micro-plugin/vue.config.js +7 -3
- package/templates/vue3vite-micro-button/src/App.vue.tpl +5 -3
- package/templates/vue3vite-micro-plugin/src/App.vue.tpl +4 -2
- package/templates/angular-micro-app/examples/main.css +0 -2
- package/templates/angular-micro-app/examples/main.js +0 -2
- package/templates/angular-micro-app/examples/main.js.LICENSE.txt +0 -52
- package/templates/angular-micro-app/examples/playground.html +0 -1
- package/templates/angular-micro-app/examples/react-dom.production.min.js +0 -2
- package/templates/angular-micro-app/examples/react-dom.production.min.js.LICENSE.txt +0 -8
- package/templates/angular-micro-app/examples/react.production.min.js +0 -2
- package/templates/angular-micro-app/examples/react.production.min.js.LICENSE.txt +0 -8
- package/templates/angular-micro-app/examples/vue.runtime.global.js +0 -9054
- package/templates/angular-micro-app/examples/zone.umd.min.js +0 -2
- package/templates/angular-micro-app/examples/zone.umd.min.js.LICENSE.txt +0 -29
- package/templates/angular-micro-field/examples/main.css +0 -2
- package/templates/angular-micro-field/examples/main.js +0 -2
- package/templates/angular-micro-field/examples/main.js.LICENSE.txt +0 -52
- package/templates/angular-micro-field/examples/playground.html +0 -1
- package/templates/angular-micro-field/examples/react-dom.production.min.js +0 -2
- package/templates/angular-micro-field/examples/react-dom.production.min.js.LICENSE.txt +0 -8
- package/templates/angular-micro-field/examples/react.production.min.js +0 -2
- package/templates/angular-micro-field/examples/react.production.min.js.LICENSE.txt +0 -8
- package/templates/angular-micro-field/examples/vue.runtime.global.js +0 -9054
- package/templates/angular-micro-field/examples/zone.umd.min.js +0 -2
- package/templates/angular-micro-field/examples/zone.umd.min.js.LICENSE.txt +0 -29
- package/templates/playground/dist/main.css +0 -2
- package/templates/playground/dist/main.js +0 -2
- package/templates/playground/dist/main.js.LICENSE.txt +0 -52
- package/templates/playground/dist/playground.html +0 -1
- package/templates/playground/dist/react-dom.production.min.js +0 -2
- package/templates/playground/dist/react-dom.production.min.js.LICENSE.txt +0 -8
- package/templates/playground/dist/react.production.min.js +0 -2
- package/templates/playground/dist/react.production.min.js.LICENSE.txt +0 -8
- package/templates/playground/dist/vue.runtime.global.js +0 -9054
- package/templates/playground/dist/zone.umd.min.js +0 -2
- package/templates/playground/dist/zone.umd.min.js.LICENSE.txt +0 -29
package/lib/index.js
CHANGED
|
@@ -69,9 +69,9 @@ var ConfigTypeEnum;
|
|
|
69
69
|
ConfigTypeEnum["HTML"] = "html";
|
|
70
70
|
})(ConfigTypeEnum || (ConfigTypeEnum = {}));
|
|
71
71
|
var create = function (pluginName, options) { return __awaiter(void 0, void 0, void 0, function () {
|
|
72
|
-
var targetDir, PROJECT_TYPE, PROJECT_FRAME, PROJECT_CONFIG_TYPE, _a, TEMPLATE, type, _b, framework, configurationType, choices, _c,
|
|
73
|
-
return __generator(this, function (
|
|
74
|
-
switch (
|
|
72
|
+
var targetDir, PROJECT_TYPE, PROJECT_FRAME, PROJECT_CONFIG_TYPE, _a, TEMPLATE, type, _b, framework, configurationType, choices, _c, templateName, templateDir, ignore, files, ejsData;
|
|
73
|
+
return __generator(this, function (_d) {
|
|
74
|
+
switch (_d.label) {
|
|
75
75
|
case 0:
|
|
76
76
|
console.log(figlet_1.default.textSync('maxelms cli'));
|
|
77
77
|
targetDir = path_1.default.resolve(process.cwd(), pluginName);
|
|
@@ -88,29 +88,29 @@ var create = function (pluginName, options) { return __awaiter(void 0, void 0, v
|
|
|
88
88
|
message: '请选择项目类型:',
|
|
89
89
|
choices: [
|
|
90
90
|
{
|
|
91
|
-
name: '
|
|
91
|
+
name: '页面组件(页面设计器配置)',
|
|
92
92
|
value: ProjectTypeEnum.MICROPLUGIN
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
|
-
name: '
|
|
95
|
+
name: '属性组件(属性组件配置)',
|
|
96
96
|
value: ProjectTypeEnum.MICROFIELD
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
|
-
name: '
|
|
99
|
+
name: '微应用(菜单应用)',
|
|
100
100
|
value: ProjectTypeEnum.MICROAPP
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
|
-
name: '
|
|
103
|
+
name: '按钮组件(按钮配置)',
|
|
104
104
|
value: ProjectTypeEnum.MICROBUTTON
|
|
105
105
|
},
|
|
106
106
|
// {
|
|
107
107
|
// name: '导航组件(替换系统内置的导航组件)',
|
|
108
108
|
// value: ProjectTypeEnum.NAV
|
|
109
109
|
// },
|
|
110
|
-
{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
},
|
|
110
|
+
// {
|
|
111
|
+
// name: '主题样式(通过 css 样式表覆盖系统默认样式)',
|
|
112
|
+
// value: ProjectTypeEnum.STYLE
|
|
113
|
+
// },
|
|
114
114
|
// {
|
|
115
115
|
// name: '扩展脚本(在系统初始化时加载并执行指定的 js 文件)',
|
|
116
116
|
// value: ProjectTypeEnum.SCRIPT
|
|
@@ -118,8 +118,8 @@ var create = function (pluginName, options) { return __awaiter(void 0, void 0, v
|
|
|
118
118
|
],
|
|
119
119
|
}).then(function (re) { return re.type; })];
|
|
120
120
|
case 1:
|
|
121
|
-
_b = (
|
|
122
|
-
|
|
121
|
+
_b = (_d.sent());
|
|
122
|
+
_d.label = 2;
|
|
123
123
|
case 2:
|
|
124
124
|
type = _b;
|
|
125
125
|
framework = '';
|
|
@@ -128,7 +128,7 @@ var create = function (pluginName, options) { return __awaiter(void 0, void 0, v
|
|
|
128
128
|
ProjectTypeEnum.NAV,
|
|
129
129
|
ProjectTypeEnum.STYLE,
|
|
130
130
|
ProjectTypeEnum.SCRIPT
|
|
131
|
-
].includes(type)) return [3 /*break*/,
|
|
131
|
+
].includes(type)) return [3 /*break*/, 5];
|
|
132
132
|
choices = frameworks.map(function (framework) {
|
|
133
133
|
return {
|
|
134
134
|
name: framework,
|
|
@@ -149,31 +149,29 @@ var create = function (pluginName, options) { return __awaiter(void 0, void 0, v
|
|
|
149
149
|
choices: choices,
|
|
150
150
|
}).then(function (re) { return re.framework; })];
|
|
151
151
|
case 3:
|
|
152
|
-
_c = (
|
|
153
|
-
|
|
152
|
+
_c = (_d.sent());
|
|
153
|
+
_d.label = 4;
|
|
154
154
|
case 4:
|
|
155
155
|
framework = _c;
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
})
|
|
156
|
+
if (type === ProjectTypeEnum.MICROFIELD || type === ProjectTypeEnum.MICROPLUGIN || type === ProjectTypeEnum.MICROBUTTON) {
|
|
157
|
+
configurationType = ConfigTypeEnum.JSON;
|
|
158
|
+
// } else {
|
|
159
|
+
// configurationType = ConfigTypeEnum[PROJECT_CONFIG_TYPE] || await inquirer.prompt(
|
|
160
|
+
// {
|
|
161
|
+
// name: 'configurationType',
|
|
162
|
+
// type: 'list',
|
|
163
|
+
// message: '请选择配置类型:',
|
|
164
|
+
// choices: Object.keys(ConfigTypeEnum).map((key) => {
|
|
165
|
+
// return {
|
|
166
|
+
// name: key,
|
|
167
|
+
// value: ConfigTypeEnum[key as keyof typeof ConfigTypeEnum],
|
|
168
|
+
// };
|
|
169
|
+
// }),
|
|
170
|
+
// },
|
|
171
|
+
// ).then((re: any) => re.configurationType)
|
|
172
|
+
}
|
|
173
|
+
_d.label = 5;
|
|
170
174
|
case 5:
|
|
171
|
-
_d = (_e.sent());
|
|
172
|
-
_e.label = 6;
|
|
173
|
-
case 6:
|
|
174
|
-
configurationType = _d;
|
|
175
|
-
_e.label = 7;
|
|
176
|
-
case 7:
|
|
177
175
|
templateName = "".concat(framework, "-").concat(type);
|
|
178
176
|
if (type === ProjectTypeEnum.NAV) {
|
|
179
177
|
templateName = 'maxelms-navigation';
|
|
@@ -199,8 +197,8 @@ var create = function (pluginName, options) { return __awaiter(void 0, void 0, v
|
|
|
199
197
|
ignore.push.apply(ignore, ['**/configuration/**', '**/configuration.html']);
|
|
200
198
|
}
|
|
201
199
|
return [4 /*yield*/, (0, utils_1.readFiles)(templateDir, ignore)];
|
|
202
|
-
case
|
|
203
|
-
files =
|
|
200
|
+
case 6:
|
|
201
|
+
files = _d.sent();
|
|
204
202
|
ejsData = {
|
|
205
203
|
pluginName: pluginName,
|
|
206
204
|
configurationType: configurationType,
|
|
@@ -210,17 +208,16 @@ var create = function (pluginName, options) { return __awaiter(void 0, void 0, v
|
|
|
210
208
|
};
|
|
211
209
|
(0, utils_1.replaceTplVars)(files, ejsData);
|
|
212
210
|
return [4 /*yield*/, (0, utils_1.writeFiles)(targetDir, files)];
|
|
213
|
-
case
|
|
214
|
-
|
|
215
|
-
if (
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
case 11:
|
|
211
|
+
case 7:
|
|
212
|
+
_d.sent();
|
|
213
|
+
// if (
|
|
214
|
+
// [
|
|
215
|
+
// ProjectTypeEnum.MICROFIELD,
|
|
216
|
+
// ProjectTypeEnum.MICROPLUGIN,
|
|
217
|
+
// ].includes(type)
|
|
218
|
+
// ) {
|
|
219
|
+
// await createPlayground(targetDir);
|
|
220
|
+
// }
|
|
224
221
|
console.log(chalk_1.default.greenBright("\n \u9879\u76EE\u521B\u5EFA\u6210\u529F\uFF01\n\n cd ".concat(pluginName, "\n\n yarn && yarn start\n ")));
|
|
225
222
|
return [2 /*return*/];
|
|
226
223
|
}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ const config = {
|
|
|
17
17
|
: '[name].bundle.js',
|
|
18
18
|
},
|
|
19
19
|
devServer: {
|
|
20
|
-
open: ['/'
|
|
20
|
+
open: ['/'],
|
|
21
21
|
host: 'localhost',
|
|
22
22
|
port: 8080,
|
|
23
23
|
headers: {
|
|
@@ -40,9 +40,7 @@ const config = {
|
|
|
40
40
|
cookieDomainRewrite: '',
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
|
-
static: [{
|
|
44
|
-
directory: path.join(__dirname, 'examples/'),
|
|
45
|
-
}, {
|
|
43
|
+
static: [ {
|
|
46
44
|
directory: path.join(__dirname, 'public/'),
|
|
47
45
|
}],
|
|
48
46
|
},
|
|
@@ -17,7 +17,7 @@ const config = {
|
|
|
17
17
|
: '[name].bundle.js',
|
|
18
18
|
},
|
|
19
19
|
devServer: {
|
|
20
|
-
open: ['/'
|
|
20
|
+
open: ['/'],
|
|
21
21
|
host: 'localhost',
|
|
22
22
|
port: 8080,
|
|
23
23
|
headers: {
|
|
@@ -41,8 +41,6 @@ const config = {
|
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
43
|
static: [{
|
|
44
|
-
directory: path.join(__dirname, 'examples/'),
|
|
45
|
-
}, {
|
|
46
44
|
directory: path.join(__dirname, 'public/'),
|
|
47
45
|
}],
|
|
48
46
|
},
|
|
@@ -17,7 +17,7 @@ const config = {
|
|
|
17
17
|
: '[name].bundle.js',
|
|
18
18
|
},
|
|
19
19
|
devServer: {
|
|
20
|
-
open: ['/'
|
|
20
|
+
open: ['/'],
|
|
21
21
|
host: 'localhost',
|
|
22
22
|
port: 8080,
|
|
23
23
|
headers: {
|
|
@@ -41,8 +41,6 @@ const config = {
|
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
43
|
static: [{
|
|
44
|
-
directory: path.join(__dirname, 'examples/'),
|
|
45
|
-
}, {
|
|
46
44
|
directory: path.join(__dirname, 'public/'),
|
|
47
45
|
}],
|
|
48
46
|
},
|
|
@@ -7,25 +7,13 @@ import styles from './index.less'
|
|
|
7
7
|
const Home = () => {
|
|
8
8
|
/** 平台传递给微应用的状态数据 */
|
|
9
9
|
const props = React.useContext(MasterContext)
|
|
10
|
-
|
|
11
|
-
const { configurations } = props || {}
|
|
12
|
-
/** configurations 是组件的配置项信息 */
|
|
13
|
-
const {
|
|
14
|
-
propName1: placeholder,
|
|
15
|
-
propName2: width = 350,
|
|
16
|
-
propName3: disabled,
|
|
17
|
-
} = configurations || {}
|
|
10
|
+
console.log('props', props)
|
|
18
11
|
|
|
19
12
|
return (
|
|
20
13
|
<div className={styles.container}>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
disabled={disabled}
|
|
25
|
-
placeholder={placeholder}
|
|
26
|
-
defaultValue="欢迎使用 Maxelms 微应用"
|
|
27
|
-
/>
|
|
28
|
-
</div>
|
|
14
|
+
<Input
|
|
15
|
+
defaultValue="欢迎使用 Maxelms 微应用"
|
|
16
|
+
/>
|
|
29
17
|
</div>
|
|
30
18
|
);
|
|
31
19
|
};
|
|
@@ -6,6 +6,7 @@ const App = (props: any) => {
|
|
|
6
6
|
const { originalButtonProps, bizData, pluginEnv, userInfo } = props
|
|
7
7
|
const { name = <button>自定义按钮</button> } = originalButtonProps || {}
|
|
8
8
|
const [visible, setVisible] = React.useState(false)
|
|
9
|
+
console.log('props', props)
|
|
9
10
|
|
|
10
11
|
const onOk = () => {
|
|
11
12
|
setVisible(false)
|
|
@@ -7,12 +7,7 @@ const prefixCls = 'maxelms-customize-component-<%= timestamp %>'
|
|
|
7
7
|
const App = (props: any) => {
|
|
8
8
|
/** 当组件运行在 系统应用时才存在 props 属性 */
|
|
9
9
|
const { configurations, value, onChange, readOnly } = props
|
|
10
|
-
|
|
11
|
-
const {
|
|
12
|
-
propName1: placeholder,
|
|
13
|
-
propName2: width = 350,
|
|
14
|
-
propName3: disabled,
|
|
15
|
-
} = configurations || {}
|
|
10
|
+
console.log('props', props)
|
|
16
11
|
|
|
17
12
|
/** value、onChange 是属性组件作为表单受控组件的必要属性 */
|
|
18
13
|
const inputValue = value?.value || "欢迎使用 Maxelms 属性组件"
|
|
@@ -36,11 +31,8 @@ const App = (props: any) => {
|
|
|
36
31
|
<div className={prefixCls}>
|
|
37
32
|
<div>
|
|
38
33
|
<Input
|
|
39
|
-
style={{ width }}
|
|
40
34
|
value={inputValue}
|
|
41
35
|
onChange={onInputChange}
|
|
42
|
-
disabled={disabled}
|
|
43
|
-
placeholder={placeholder}
|
|
44
36
|
/>
|
|
45
37
|
</div>
|
|
46
38
|
</div>
|
|
@@ -27,15 +27,12 @@ const config = {
|
|
|
27
27
|
: '[name].bundle.js',
|
|
28
28
|
},
|
|
29
29
|
devServer: {
|
|
30
|
-
open: ['/'
|
|
30
|
+
open: ['/'],
|
|
31
31
|
host: 'localhost',
|
|
32
32
|
port: 8080,
|
|
33
33
|
headers: {
|
|
34
34
|
'Access-Control-Allow-Origin': '*',
|
|
35
|
-
}
|
|
36
|
-
static: {
|
|
37
|
-
directory: path.join(__dirname, 'examples/'),
|
|
38
|
-
},
|
|
35
|
+
}
|
|
39
36
|
},
|
|
40
37
|
plugins: [
|
|
41
38
|
new CleanWebpackPlugin(),
|
|
@@ -6,21 +6,12 @@ const prefixCls = 'maxelms-customize-component-<%= timestamp %>'
|
|
|
6
6
|
|
|
7
7
|
const App = (props: any) => {
|
|
8
8
|
/** 当组件运行在 系统应用时才存在 props 属性 */
|
|
9
|
-
|
|
10
|
-
const { configurations } = props
|
|
11
|
-
const {
|
|
12
|
-
propName1: placeholder,
|
|
13
|
-
propName2: width = 350,
|
|
14
|
-
propName3: disabled,
|
|
15
|
-
} = configurations || {}
|
|
9
|
+
console.log('props', props)
|
|
16
10
|
|
|
17
11
|
return (
|
|
18
12
|
<div className={prefixCls}>
|
|
19
13
|
<div>
|
|
20
14
|
<Input
|
|
21
|
-
style={{ width }}
|
|
22
|
-
disabled={disabled}
|
|
23
|
-
placeholder={placeholder}
|
|
24
15
|
defaultValue="欢迎使用 Maxelms 页面组件"
|
|
25
16
|
/>
|
|
26
17
|
</div>
|
|
@@ -27,15 +27,13 @@ const config = {
|
|
|
27
27
|
: '[name].bundle.js',
|
|
28
28
|
},
|
|
29
29
|
devServer: {
|
|
30
|
-
open: ['/'
|
|
30
|
+
open: ['/'],
|
|
31
31
|
host: 'localhost',
|
|
32
32
|
port: 8080,
|
|
33
33
|
headers: {
|
|
34
34
|
'Access-Control-Allow-Origin': '*',
|
|
35
35
|
},
|
|
36
36
|
static: [{
|
|
37
|
-
directory: path.join(__dirname, 'examples/'),
|
|
38
|
-
}, {
|
|
39
37
|
directory: path.join(__dirname, 'public/')
|
|
40
38
|
}],
|
|
41
39
|
},
|
|
@@ -28,8 +28,6 @@ module.exports = {
|
|
|
28
28
|
"Access-Control-Allow-Origin": "*",
|
|
29
29
|
},
|
|
30
30
|
port: 8080,
|
|
31
|
-
// open: ['/', '/playground.html'],
|
|
32
|
-
// contentBase: path.join(__dirname, 'examples/'),
|
|
33
31
|
},
|
|
34
32
|
chainWebpack: (config) => {
|
|
35
33
|
config.module
|
|
@@ -46,6 +44,11 @@ module.exports = {
|
|
|
46
44
|
{ from: 'README.md' },
|
|
47
45
|
{ from: 'manifest.json' },
|
|
48
46
|
]),
|
|
49
|
-
]
|
|
47
|
+
],
|
|
48
|
+
resolve: {
|
|
49
|
+
alias: {
|
|
50
|
+
'vue$': 'vue/dist/vue.esm-bundler.js'
|
|
51
|
+
}
|
|
52
|
+
}
|
|
50
53
|
},
|
|
51
54
|
};
|
|
@@ -28,8 +28,7 @@ module.exports = {
|
|
|
28
28
|
"Access-Control-Allow-Origin": "*",
|
|
29
29
|
},
|
|
30
30
|
port: 8080,
|
|
31
|
-
open: ['/'
|
|
32
|
-
contentBase: path.join(__dirname, 'examples/'),
|
|
31
|
+
open: ['/'],
|
|
33
32
|
},
|
|
34
33
|
chainWebpack: (config) => {
|
|
35
34
|
config.module
|
|
@@ -45,7 +44,12 @@ module.exports = {
|
|
|
45
44
|
new CopyWebpackPlugin([
|
|
46
45
|
{ from: 'README.md' },
|
|
47
46
|
{ from: 'manifest.json' },
|
|
48
|
-
])
|
|
49
|
-
]
|
|
47
|
+
])
|
|
48
|
+
],
|
|
49
|
+
resolve: {
|
|
50
|
+
alias: {
|
|
51
|
+
'vue$': 'vue/dist/vue.esm-bundler.js'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
50
54
|
},
|
|
51
55
|
};
|
|
@@ -28,8 +28,7 @@ module.exports = {
|
|
|
28
28
|
"Access-Control-Allow-Origin": "*",
|
|
29
29
|
},
|
|
30
30
|
port: 8080,
|
|
31
|
-
open: ['/'
|
|
32
|
-
contentBase: path.join(__dirname, 'examples/'),
|
|
31
|
+
open: ['/'],
|
|
33
32
|
},
|
|
34
33
|
chainWebpack: (config) => {
|
|
35
34
|
config.module
|
|
@@ -48,6 +47,11 @@ module.exports = {
|
|
|
48
47
|
{ from: 'README.md' },
|
|
49
48
|
{ from: 'manifest.json' },
|
|
50
49
|
]),
|
|
51
|
-
]
|
|
50
|
+
],
|
|
51
|
+
resolve: {
|
|
52
|
+
alias: {
|
|
53
|
+
'vue$': 'vue/dist/vue.esm-bundler.js'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
52
56
|
},
|
|
53
57
|
};
|
|
@@ -31,8 +31,10 @@ export default {
|
|
|
31
31
|
},
|
|
32
32
|
methods: {
|
|
33
33
|
updateMasterProps(newProps) {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
if (this.masterProps) {
|
|
35
|
+
// 更新本地数据,触发响应式更新
|
|
36
|
+
Object.assign(this.masterProps, newProps);
|
|
37
|
+
}
|
|
36
38
|
},
|
|
37
39
|
},
|
|
38
40
|
created() {
|
|
@@ -21,8 +21,7 @@ module.exports = {
|
|
|
21
21
|
"Access-Control-Allow-Origin": "*",
|
|
22
22
|
},
|
|
23
23
|
port: 8080,
|
|
24
|
-
open: ['/'
|
|
25
|
-
contentBase: path.join(__dirname, 'examples/'),
|
|
24
|
+
open: ['/']
|
|
26
25
|
},
|
|
27
26
|
chainWebpack: (config) => {
|
|
28
27
|
config.module
|
|
@@ -41,6 +40,12 @@ module.exports = {
|
|
|
41
40
|
{ from: 'README.md' },
|
|
42
41
|
{ from: 'manifest.json' },
|
|
43
42
|
]),
|
|
44
|
-
|
|
43
|
+
|
|
44
|
+
],
|
|
45
|
+
resolve: {
|
|
46
|
+
alias: {
|
|
47
|
+
'vue$': 'vue/dist/vue.esm-bundler.js'
|
|
48
|
+
}
|
|
49
|
+
}
|
|
45
50
|
},
|
|
46
51
|
};
|
|
@@ -34,8 +34,10 @@ export default {
|
|
|
34
34
|
},
|
|
35
35
|
methods: {
|
|
36
36
|
updateMasterProps(newProps) {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
if (this.masterProps) {
|
|
38
|
+
// 更新本地数据,触发响应式更新
|
|
39
|
+
Object.assign(this.masterProps, newProps);
|
|
40
|
+
}
|
|
39
41
|
},
|
|
40
42
|
change(e) {
|
|
41
43
|
this.onChange && this.onChange({
|
|
@@ -21,8 +21,7 @@ module.exports = {
|
|
|
21
21
|
"Access-Control-Allow-Origin": "*",
|
|
22
22
|
},
|
|
23
23
|
port: 8080,
|
|
24
|
-
open: ['/'
|
|
25
|
-
contentBase: path.join(__dirname, 'examples/'),
|
|
24
|
+
open: ['/']
|
|
26
25
|
},
|
|
27
26
|
chainWebpack: (config) => {
|
|
28
27
|
config.module
|
|
@@ -41,6 +40,11 @@ module.exports = {
|
|
|
41
40
|
{ from: 'README.md' },
|
|
42
41
|
{ from: 'manifest.json' },
|
|
43
42
|
]),
|
|
44
|
-
]
|
|
43
|
+
],
|
|
44
|
+
resolve: {
|
|
45
|
+
alias: {
|
|
46
|
+
'vue$': 'vue/dist/vue.esm-bundler.js'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
45
49
|
},
|
|
46
50
|
};
|
|
@@ -22,12 +22,19 @@ export default {
|
|
|
22
22
|
props: {
|
|
23
23
|
mainProps: {}
|
|
24
24
|
},
|
|
25
|
+
data() {
|
|
26
|
+
return {
|
|
27
|
+
masterProps: { ...this.mainProps }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
25
30
|
components: {
|
|
26
31
|
},
|
|
27
32
|
methods: {
|
|
28
33
|
updateMasterProps(newProps) {
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
if (this.masterProps) {
|
|
35
|
+
// 更新本地数据,触发响应式更新
|
|
36
|
+
Object.assign(this.masterProps, newProps);
|
|
37
|
+
}
|
|
31
38
|
},
|
|
32
39
|
},
|
|
33
40
|
computed: {
|
|
@@ -21,8 +21,7 @@ module.exports = {
|
|
|
21
21
|
"Access-Control-Allow-Origin": "*",
|
|
22
22
|
},
|
|
23
23
|
port: 8080,
|
|
24
|
-
open: ['/'
|
|
25
|
-
contentBase: path.join(__dirname, 'examples/'),
|
|
24
|
+
open: ['/']
|
|
26
25
|
},
|
|
27
26
|
chainWebpack: (config) => {
|
|
28
27
|
config.module
|
|
@@ -41,6 +40,11 @@ module.exports = {
|
|
|
41
40
|
{ from: 'README.md' },
|
|
42
41
|
{ from: 'manifest.json' },
|
|
43
42
|
]),
|
|
44
|
-
]
|
|
43
|
+
],
|
|
44
|
+
resolve: {
|
|
45
|
+
alias: {
|
|
46
|
+
'vue$': 'vue/dist/vue.esm-bundler.js'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
45
49
|
},
|
|
46
50
|
};
|
|
@@ -28,12 +28,14 @@ export default {
|
|
|
28
28
|
methods: {
|
|
29
29
|
// 正确的方法来更新 masterProps
|
|
30
30
|
updateMasterProps(newProps) {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
if (this.masterProps) {
|
|
32
|
+
// 更新本地数据,触发响应式更新
|
|
33
|
+
Object.assign(this.masterProps, newProps);
|
|
34
|
+
}
|
|
33
35
|
},
|
|
34
36
|
},
|
|
35
37
|
created() {
|
|
36
|
-
|
|
38
|
+
console.log('masterProps', this.masterProps)
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
</script>
|
|
@@ -28,8 +28,10 @@ export default {
|
|
|
28
28
|
methods: {
|
|
29
29
|
// 正确的方法来更新 masterProps
|
|
30
30
|
updateMasterProps(newProps) {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
if (this.masterProps) {
|
|
32
|
+
// 更新本地数据,触发响应式更新
|
|
33
|
+
Object.assign(this.masterProps, newProps);
|
|
34
|
+
}
|
|
33
35
|
},
|
|
34
36
|
},
|
|
35
37
|
computed: {
|