50 lines
1.5 KiB
JavaScript
50 lines
1.5 KiB
JavaScript
"use strict";
|
||
const common_vendor = require("../../../../common/vendor.js");
|
||
const _sfc_main = {
|
||
name: "u-steps",
|
||
mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$8],
|
||
data() {
|
||
return {};
|
||
},
|
||
watch: {
|
||
children() {
|
||
this.updateChildData();
|
||
},
|
||
parentData() {
|
||
this.updateChildData();
|
||
}
|
||
},
|
||
computed: {
|
||
// 监听参数的变化,通过watch中,手动去更新子组件的数据,否则子组件不会自动变化
|
||
parentData() {
|
||
return [this.current, this.direction, this.activeColor, this.inactiveColor, this.activeIcon, this.inactiveIcon, this.dot];
|
||
}
|
||
},
|
||
methods: {
|
||
// 更新子组件的数据
|
||
updateChildData() {
|
||
this.children.map((child) => {
|
||
common_vendor.test.func((child || {}).updateFromParent()) && child.updateFromParent();
|
||
});
|
||
},
|
||
// 接受子组件的通知,去修改其他子组件的数据
|
||
updateFromChild() {
|
||
this.updateChildData();
|
||
}
|
||
},
|
||
created() {
|
||
this.children = [];
|
||
},
|
||
options: {
|
||
virtualHost: false
|
||
}
|
||
};
|
||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||
return {
|
||
a: common_vendor.n(`u-steps--${_ctx.direction}`)
|
||
};
|
||
}
|
||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-30d91cab"]]);
|
||
wx.createComponent(Component);
|
||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/node-modules/uview-plus/components/u-steps/u-steps.js.map
|