纸通宝商家版本的小程序,原生微信开发。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

74 lines
1.2 KiB

Component({
externalClasses: [
'l-class'
],
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
relations: {
'../step/index': {
type: 'child',
linked() {
this.initSteps();
},
unlinked() {
this.initSteps();
}
},
},
properties: {
direction: {
type: String,
value: 'row',
options: ['row', 'column']
},
activeIndex: {
type: Number,
value: 0
},
color: String,
stepMinHeight: {
type: String,
value: '120'
},
status: {
type: String,
value: 'process',
options: ['process', 'error']
},
dot: Boolean
},
observers: {
'activeIndex': function () {
this.initSteps()
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
initSteps() {
let steps = this.getRelationNodes('../step/index')
this.data.length = steps.length
if (this.data.length > 0) {
steps.forEach((step, index) => {
step.updateDataChange({
index,
...this.data,
stepsWidth: 375
});
});
}
}
}
});