<th-form-item label="所在地区:" prop ="address">
{{`${res.Province}-${res.City}-${res.District}`}}
<th-form-item>
2.组件刷新表单
在组件里面抛出一个refresh事件
this.$emit('refresh');
然后在index.vue 用@refresh里面进行刷新
<expand-modal @refresh="getTableData"></expand-modal>
3.组件想在里面控制外面的显示隐藏
export default {
props: {
value: Boolean,
id: {
type: Array,
default: () => []
}
},
methods: {
closeModal() {
this.show = false;
this.$emit('input', false);
},
}
data(){
show: this.value,
}
<th-modal v-modal="show" @on-cancel="cancel"></th-modal>