chore: children use reactive

This commit is contained in:
chenjiahan
2020-08-26 11:34:16 +08:00
parent 326c345c91
commit b0ea4bc1f6
6 changed files with 16 additions and 18 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { ref, watch, provide } from 'vue';
import { watch, provide, reactive } from 'vue';
import { createNamespace } from '../utils';
const [createComponent, bem] = createNamespace('sidebar');
@@ -16,7 +16,7 @@ export default createComponent({
emits: ['change', 'update:modelValue'],
setup(props, { emit, slots }) {
const children = ref([]);
const children = reactive([]);
const active = () => +props.modelValue;
const setActive = (value) => {
if (value !== active()) {