49 lines
1.5 KiB
JavaScript
Raw Normal View History

2025-10-29 13:53:24 +08:00
"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$5],
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"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/node_modules/uview-plus/components/u-steps/u-steps.vue"]]);
wx.createComponent(Component);