<SG-Tree showIcon v-model="selectValue" > </SG-Tree> props: { selectedKeys: {// 改model值是外界傳入的 type: Array, default: () => { return [] } } } data () { return { // 不使用中間值的話。v-vodel改變,會觸發屬性改變,會報這個錯:Avoid mutating a prop directly since the value will be overwritten selectValue: this.selectedKeys, // 中間值,為了使不報錯 } } watch: { selectedKeys:{ handler (val) { this.selectValue = val }, deep: true, immediate: true } }