方法一
props: {
value: {
type: String,
default: () => {
return ''
}
}
},
computed: {
radioList() {
var list = this.value
return list.filter(item => item.type == 'radio')
},
},
methods: {
change(val) {
this.$emit('event', param);
},
}
方法二
model: {
prop: 'modelVal',//指向props的参数名
event: 'change'//事件名称
},
props: {
modelVal: '',
},
computed: {
imageUrl() {
return this.modelVal;
}
},
methods: {
change(val) {
this.$emit('change', res.rspBody.relativelyPath);
},
}