src/views/common/search-select.vue
@@ -106,13 +106,11 @@ }, created() {}, mounted() { console.log(this.option) }, methods: {}, watch: { 'option.data': { handler(val) { console.log(val) // 强制改为Number类型,不然页面展示的是字符串id this.option.select = Number( this.dataForm.id || this.$route.params.id || this.$route.query.id || 0 @@ -120,12 +118,6 @@ if (this.option.select === 0) { this.option.select = '' } console.log( this.option.data.length, this.option.select, 'SearchSelectOption' ) }, deep: true }