diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-09-21 21:04:59 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-09-21 21:04:59 +0900 |
| commit | 72a49f334a58db61e2f977f5e53f28c1491f9da8 (patch) | |
| tree | 926d249823e0a81d7778df0192a8442337541548 /src/client/components | |
| parent | :art: (diff) | |
| download | sharkey-72a49f334a58db61e2f977f5e53f28c1491f9da8.tar.gz sharkey-72a49f334a58db61e2f977f5e53f28c1491f9da8.tar.bz2 sharkey-72a49f334a58db61e2f977f5e53f28c1491f9da8.zip | |
enhance(client): リスト、アンテナタイムラインを個別ページとして分割
Diffstat (limited to 'src/client/components')
| -rw-r--r-- | src/client/components/ui/menu.vue | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/client/components/ui/menu.vue b/src/client/components/ui/menu.vue index d652d9b84f..26b4b04b11 100644 --- a/src/client/components/ui/menu.vue +++ b/src/client/components/ui/menu.vue @@ -41,7 +41,7 @@ </template> <script lang="ts"> -import { defineComponent, ref } from 'vue'; +import { defineComponent, ref, unref } from 'vue'; import { focusPrev, focusNext } from '@client/scripts/focus'; import contains from '@client/scripts/contains'; @@ -79,21 +79,26 @@ export default defineComponent({ }; }, }, - created() { - const items = ref(this.items.filter(item => item !== undefined)); + watch: { + items: { + handler() { + const items = ref(unref(this.items).filter(item => item !== undefined)); - for (let i = 0; i < items.value.length; i++) { - const item = items.value[i]; - - if (item && item.then) { // if item is Promise - items.value[i] = { type: 'pending' }; - item.then(actualItem => { - items.value[i] = actualItem; - }); - } - } + for (let i = 0; i < items.value.length; i++) { + const item = items.value[i]; + + if (item && item.then) { // if item is Promise + items.value[i] = { type: 'pending' }; + item.then(actualItem => { + items.value[i] = actualItem; + }); + } + } - this._items = items; + this._items = items; + }, + immediate: true + } }, mounted() { if (this.viaKeyboard) { |