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

View File

@@ -24,16 +24,14 @@ export default createComponent({
const isFirst = computed(() => {
if (parent) {
const children = parent.children.value;
const prev = children[index.value - 1];
const prev = parent.children[index.value - 1];
return !(prev && prev.isButton);
}
});
const isLast = computed(() => {
if (parent) {
const children = parent.children.value;
const next = children[index.value + 1];
const next = parent.children[index.value + 1];
return !(next && next.isButton);
}
});