watch变量

This commit is contained in:
xuyanfeng 2021-04-06 18:50:58 +08:00
parent d0b832b117
commit 08a055fe27

View File

@ -17,7 +17,8 @@
<script lang="ts">
import Vue from "vue"
import {Component, Prop} from "vue-property-decorator"
import {Component, Prop, Watch} from "vue-property-decorator"
import UiProp from "./ui-prop.vue"
import {DataType, testData} from "../data";
@ -40,9 +41,19 @@ export default class NodeBaseProperty extends Vue {
private label?: string | undefined
setup() {
}
@Watch('allGroup')
watchAllGroup() {
this._initValue();
}
created() {
this._initValue();
}
_initValue() {
if (this.allGroup) {
this.allGroup.forEach(item => {
this.$set(item, 'fold', false);
@ -50,7 +61,6 @@ export default class NodeBaseProperty extends Vue {
}
}
changeColor() {
let color = this.itemData.color;
console.log("color:" + color);