@maxelms/create-plugin-cli 1.1.27 → 1.1.29
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/package.json +1 -1
- package/templates/vue-micro-button/src/main.js +1 -0
- package/templates/vue3-micro-button/src/App.vue.tpl +6 -1
- package/templates/vue3-micro-button/src/main.js +3 -3
- package/templates/vue3-micro-field/src/App.vue.tpl +6 -0
- package/templates/vue3-micro-field/src/main.js +3 -3
- package/templates/vue3-micro-plugin/src/App.vue.tpl +6 -1
- package/templates/vue3-micro-plugin/src/main.js +3 -3
- package/templates/vue3vite-micro-button/src/App.vue.tpl +6 -1
- package/templates/vue3vite-micro-button/src/main.ts +2 -2
- package/templates/vue3vite-micro-plugin/src/App.vue.tpl +6 -1
- package/templates/vue3vite-micro-plugin/src/main.ts +2 -2
package/package.json
CHANGED
|
@@ -32,7 +32,12 @@ export default {
|
|
|
32
32
|
|
|
33
33
|
},
|
|
34
34
|
methods: {
|
|
35
|
-
|
|
35
|
+
updateMasterProps(newProps) {
|
|
36
|
+
// 更新本地数据,这会触发响应式更新
|
|
37
|
+
this.localMasterProps = { ...newProps };
|
|
38
|
+
// 同时触发事件通知父组件
|
|
39
|
+
this.$emit('update:masterProps', newProps);
|
|
40
|
+
},
|
|
36
41
|
},
|
|
37
42
|
created() {
|
|
38
43
|
console.log(this.masterProps)
|
|
@@ -14,7 +14,7 @@ const vms = {}
|
|
|
14
14
|
|
|
15
15
|
const render = (props) => {
|
|
16
16
|
const { containerId } = props || {}
|
|
17
|
-
createApp(App, {
|
|
17
|
+
vms[containerId] = createApp(App, {
|
|
18
18
|
masterProps: props || {}
|
|
19
19
|
}).mount(containerId ? `#${containerId} #root` : '#root');
|
|
20
20
|
}
|
|
@@ -25,8 +25,8 @@ if (poweredByMaxelms) {
|
|
|
25
25
|
render(props)
|
|
26
26
|
},
|
|
27
27
|
update(props) {
|
|
28
|
-
if (vms[props.containerId]) {
|
|
29
|
-
vms[props.containerId].
|
|
28
|
+
if (vms[props.containerId] && vms[props.containerId].updateMasterProps) {
|
|
29
|
+
vms[props.containerId].updateMasterProps(props);
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
unmount(props) {
|
|
@@ -30,6 +30,12 @@ export default {
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
methods: {
|
|
33
|
+
updateMasterProps(newProps) {
|
|
34
|
+
// 更新本地数据,这会触发响应式更新
|
|
35
|
+
this.localMasterProps = { ...newProps };
|
|
36
|
+
// 同时触发事件通知父组件
|
|
37
|
+
this.$emit('update:masterProps', newProps);
|
|
38
|
+
},
|
|
33
39
|
change(e) {
|
|
34
40
|
this.onChange && this.onChange({
|
|
35
41
|
text: null,
|
|
@@ -14,7 +14,7 @@ const vms = {}
|
|
|
14
14
|
|
|
15
15
|
const render = (props) => {
|
|
16
16
|
const { containerId } = props || {}
|
|
17
|
-
createApp(App, {
|
|
17
|
+
vms[containerId] = createApp(App, {
|
|
18
18
|
masterProps: props || {}
|
|
19
19
|
}).mount(containerId ? `#${containerId} #root` : '#root');
|
|
20
20
|
}
|
|
@@ -25,8 +25,8 @@ if (poweredByMaxelms) {
|
|
|
25
25
|
render(props)
|
|
26
26
|
},
|
|
27
27
|
update(props) {
|
|
28
|
-
if (vms[props.containerId]) {
|
|
29
|
-
vms[props.containerId].
|
|
28
|
+
if (vms[props.containerId] && vms[props.containerId].updateMasterProps) {
|
|
29
|
+
vms[props.containerId].updateMasterProps(props);
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
unmount(props) {
|
|
@@ -28,7 +28,12 @@ export default {
|
|
|
28
28
|
components: {
|
|
29
29
|
},
|
|
30
30
|
methods: {
|
|
31
|
-
|
|
31
|
+
updateMasterProps(newProps) {
|
|
32
|
+
// 更新本地数据,这会触发响应式更新
|
|
33
|
+
this.localMasterProps = { ...newProps };
|
|
34
|
+
// 同时触发事件通知父组件
|
|
35
|
+
this.$emit('update:masterProps', newProps);
|
|
36
|
+
}
|
|
32
37
|
},
|
|
33
38
|
computed: {
|
|
34
39
|
/** 是否禁用 */
|
|
@@ -14,7 +14,7 @@ const vms = {}
|
|
|
14
14
|
|
|
15
15
|
const render = (props) => {
|
|
16
16
|
const { containerId } = props || {}
|
|
17
|
-
createApp(App, {
|
|
17
|
+
vms[containerId] = createApp(App, {
|
|
18
18
|
masterProps: props || {}
|
|
19
19
|
}).mount(containerId ? `#${containerId} #root` : '#root');
|
|
20
20
|
}
|
|
@@ -25,8 +25,8 @@ if (poweredByMaxelms) {
|
|
|
25
25
|
render(props)
|
|
26
26
|
},
|
|
27
27
|
update(props) {
|
|
28
|
-
if (vms[props.containerId]) {
|
|
29
|
-
vms[props.containerId].
|
|
28
|
+
if (vms[props.containerId] && vms[props.containerId].updateMasterProps) {
|
|
29
|
+
vms[props.containerId].updateMasterProps(props);
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
unmount(props) {
|
|
@@ -15,8 +15,8 @@ if (poweredByMaxelms && registerPlugin) {
|
|
|
15
15
|
render(props)
|
|
16
16
|
},
|
|
17
17
|
update(props) {
|
|
18
|
-
if (vms[props.containerId]) {
|
|
19
|
-
vms[props.containerId].
|
|
18
|
+
if (vms[props.containerId] && vms[props.containerId].updateMasterProps) {
|
|
19
|
+
vms[props.containerId].updateMasterProps(props);
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
unmount(props) {
|
|
@@ -18,7 +18,12 @@ export default {
|
|
|
18
18
|
components: {
|
|
19
19
|
},
|
|
20
20
|
methods: {
|
|
21
|
-
|
|
21
|
+
updateMasterProps(newProps) {
|
|
22
|
+
// 更新本地数据,这会触发响应式更新
|
|
23
|
+
this.localMasterProps = { ...newProps };
|
|
24
|
+
// 同时触发事件通知父组件
|
|
25
|
+
this.$emit('update:masterProps', newProps);
|
|
26
|
+
}
|
|
22
27
|
},
|
|
23
28
|
computed: {
|
|
24
29
|
/** 是否禁用 */
|
|
@@ -15,8 +15,8 @@ if (poweredByMaxelms && registerPlugin) {
|
|
|
15
15
|
render(props)
|
|
16
16
|
},
|
|
17
17
|
update(props) {
|
|
18
|
-
if (vms[props.containerId]) {
|
|
19
|
-
vms[props.containerId].
|
|
18
|
+
if (vms[props.containerId] && vms[props.containerId].updateMasterProps) {
|
|
19
|
+
vms[props.containerId].updateMasterProps(props);
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
unmount(props) {
|