diff options
| author | tamaina <tamaina@hotmail.co.jp> | 2019-04-18 21:33:24 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-04-18 21:33:24 +0900 |
| commit | dab7e527de7aacdd8c4d1755627f96980617e282 (patch) | |
| tree | 4dbe10f7cf43f94b5055468796e39461330270c9 /src/client/app/mobile/views/pages | |
| parent | Resolve #4732 (diff) | |
| download | misskey-dab7e527de7aacdd8c4d1755627f96980617e282.tar.gz misskey-dab7e527de7aacdd8c4d1755627f96980617e282.tar.bz2 misskey-dab7e527de7aacdd8c4d1755627f96980617e282.zip | |
Improve user lists index (#4605)
* wip
* Revert "wip"
This reverts commit 6212831ce3bdae5ce17f8ace9945710ba7696185.
* improve list index
* Update user-lists.vue
Diffstat (limited to 'src/client/app/mobile/views/pages')
| -rw-r--r-- | src/client/app/mobile/views/pages/user-lists.vue | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/src/client/app/mobile/views/pages/user-lists.vue b/src/client/app/mobile/views/pages/user-lists.vue index 49006f41f6..a3e9bd78ba 100644 --- a/src/client/app/mobile/views/pages/user-lists.vue +++ b/src/client/app/mobile/views/pages/user-lists.vue @@ -1,20 +1,15 @@ <template> <mk-ui> <template #header><fa icon="list"/>{{ $t('title') }}</template> - <template #func><button @click="fn"><fa icon="plus"/></button></template> + <template #func><button @click="$refs.lists.add()"><fa icon="plus"/></button></template> - <main> - <ul> - <li v-for="list in lists" :key="list.id"><router-link :to="`/i/lists/${list.id}`">{{ list.name }}</router-link></li> - </ul> - </main> + <x-lists ref="lists" @choosen="choosen"/> </mk-ui> </template> <script lang="ts"> import Vue from 'vue'; import i18n from '../../../i18n'; -import Progress from '../../../common/scripts/loading'; export default Vue.extend({ i18n: i18n('mobile/views/pages/user-lists.vue'), @@ -24,31 +19,16 @@ export default Vue.extend({ lists: [] }; }, + components: { + XLists: () => import('../../../common/views/components/user-lists.vue').then(m => m.default) + }, mounted() { document.title = this.$t('title'); - - Progress.start(); - - this.$root.api('users/lists/list').then(lists => { - this.fetching = false; - this.lists = lists; - - Progress.done(); - }); }, methods: { - fn() { - this.$root.dialog({ - title: this.$t('enter-list-name'), - input: true - }).then(async ({ canceled, result: title }) => { - if (canceled) return; - const list = await this.$root.api('users/lists/create', { - title - }); - - this.$router.push(`/i/lists/${list.id}`); - }); + choosen(list) { + if (!list) return; + this.$router.push(`/i/lists/${list.id}`); } } }); |