uview-plus 3.1.9 → 3.1.11
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/changelog.md
CHANGED
|
@@ -42,9 +42,23 @@
|
|
|
42
42
|
// 所以需要手动通知子组件,这里返回一个parentData变量,供watch监听,在其中去通知每一个子组件重新从父组件(u-checkbox-group)
|
|
43
43
|
// 拉取父组件新的变化后的参数
|
|
44
44
|
parentData() {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
return [
|
|
46
|
+
// #ifdef VUE2
|
|
47
|
+
this.value,
|
|
48
|
+
// #endif
|
|
49
|
+
// #ifdef VUE3
|
|
50
|
+
this.modelValue,
|
|
51
|
+
// #endif
|
|
52
|
+
this.disabled,
|
|
53
|
+
this.inactiveColor,
|
|
54
|
+
this.activeColor,
|
|
55
|
+
this.size,
|
|
56
|
+
this.labelDisabled,
|
|
57
|
+
this.shape,
|
|
58
|
+
this.iconSize,
|
|
59
|
+
this.borderBottom,
|
|
60
|
+
this.placement,
|
|
61
|
+
];
|
|
48
62
|
},
|
|
49
63
|
bemClass() {
|
|
50
64
|
// this.bem为一个computed变量,在mixin中
|
|
@@ -53,13 +67,16 @@
|
|
|
53
67
|
},
|
|
54
68
|
watch: {
|
|
55
69
|
// 当父组件需要子组件需要共享的参数发生了变化,手动通知子组件
|
|
56
|
-
parentData
|
|
70
|
+
parentData: {
|
|
71
|
+
handler() {
|
|
57
72
|
if (this.children.length) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
73
|
+
this.children.map((child) => {
|
|
74
|
+
// 判断子组件(u-checkbox)如果有init方法的话,就就执行(执行的结果是子组件重新从父组件拉取了最新的值)
|
|
75
|
+
typeof child.init === "function" && child.init();
|
|
76
|
+
});
|
|
62
77
|
}
|
|
78
|
+
},
|
|
79
|
+
deep: true,
|
|
63
80
|
},
|
|
64
81
|
},
|
|
65
82
|
data() {
|
|
@@ -87,10 +104,10 @@
|
|
|
87
104
|
this.$emit('change', values)
|
|
88
105
|
// 修改通过v-model绑定的值
|
|
89
106
|
// #ifdef VUE3
|
|
90
|
-
this.$emit("update:modelValue",
|
|
107
|
+
this.$emit("update:modelValue", values);
|
|
91
108
|
// #endif
|
|
92
109
|
// #ifdef VUE2
|
|
93
|
-
this.$emit("input",
|
|
110
|
+
this.$emit("input", values);
|
|
94
111
|
// #endif
|
|
95
112
|
},
|
|
96
113
|
}
|