From 77ddd778be3346dac0decf60c1156fde636416cb Mon Sep 17 00:00:00 2001 From: syuilo <syuilotan@yahoo.co.jp> Date: Sat, 20 Oct 2018 08:03:45 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=8F=E3=83=83=E3=82=B7=E3=83=A5=E3=82=BF?= =?UTF-8?q?=E3=82=B0=E3=82=82=E3=83=87=E3=83=83=E3=82=AD=E5=86=85=E3=83=8A?= =?UTF-8?q?=E3=83=93=E3=82=B2=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app/desktop/script.ts | 2 +- .../views/pages/deck/deck.hashtag-column.vue | 37 +++++++++++++++++++ .../app/desktop/views/pages/deck/deck.vue | 14 ++++++- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 src/client/app/desktop/views/pages/deck/deck.hashtag-column.vue diff --git a/src/client/app/desktop/script.ts b/src/client/app/desktop/script.ts index 6b81a5aa77..765ba0202e 100644 --- a/src/client/app/desktop/script.ts +++ b/src/client/app/desktop/script.ts @@ -66,7 +66,7 @@ init(async (launch) => { { path: '/i/drive/folder/:folder', component: MkDrive }, { path: '/selectdrive', component: MkSelectDrive }, { path: '/search', component: MkSearch }, - { path: '/tags/:tag', component: MkTag }, + { path: '/tags/:tag', name: 'tag', component: MkTag }, { path: '/share', component: MkShare }, { path: '/reversi/:game?', component: MkReversi }, { path: '/@:user', name: 'user', component: MkUser }, diff --git a/src/client/app/desktop/views/pages/deck/deck.hashtag-column.vue b/src/client/app/desktop/views/pages/deck/deck.hashtag-column.vue new file mode 100644 index 0000000000..70058665e8 --- /dev/null +++ b/src/client/app/desktop/views/pages/deck/deck.hashtag-column.vue @@ -0,0 +1,37 @@ +<template> +<x-column> + <span slot="header"> + %fa:hashtag%<span>{{ tag }}</span> + </span> + + <x-hashtag-tl :tag-tl="tagTl"/> +</x-column> +</template> + +<script lang="ts"> +import Vue from 'vue'; +import XColumn from './deck.column.vue'; +import XHashtagTl from './deck.hashtag-tl.vue'; + +export default Vue.extend({ + components: { + XColumn, + XHashtagTl + }, + + props: { + tag: { + type: String, + required: true + } + }, + + computed: { + tagTl(): any { + return { + query: [[this.tag]] + }; + } + } +}); +</script> diff --git a/src/client/app/desktop/views/pages/deck/deck.vue b/src/client/app/desktop/views/pages/deck/deck.vue index 6c55f08b5c..3b3102bd72 100644 --- a/src/client/app/desktop/views/pages/deck/deck.vue +++ b/src/client/app/desktop/views/pages/deck/deck.vue @@ -12,6 +12,7 @@ <template v-if="temporaryColumn"> <x-user-column v-if="temporaryColumn.type == 'user'" :acct="temporaryColumn.acct" :key="temporaryColumn.acct"/> <x-note-column v-else-if="temporaryColumn.type == 'note'" :note-id="temporaryColumn.noteId" :key="temporaryColumn.noteId"/> + <x-hashtag-column v-else-if="temporaryColumn.type == 'tag'" :tag="temporaryColumn.tag" :key="temporaryColumn.tag"/> </template> <button ref="add" @click="add" title="%i18n:common.deck.add-column%">%fa:plus%</button> </div> @@ -25,6 +26,7 @@ import Menu from '../../../../common/views/components/menu.vue'; import MkUserListsWindow from '../../components/user-lists-window.vue'; import XUserColumn from './deck.user-column.vue'; import XNoteColumn from './deck.note-column.vue'; +import XHashtagColumn from './deck.hashtag-column.vue'; import * as uuid from 'uuid'; @@ -32,7 +34,8 @@ export default Vue.extend({ components: { XColumnCore, XUserColumn, - XNoteColumn + XNoteColumn, + XHashtagColumn }, computed: { @@ -162,6 +165,15 @@ export default Vue.extend({ } }); return true; + } else if (to.name == 'tag') { + this.$store.commit('device/set', { + key: 'deckTemporaryColumn', + value: { + type: 'tag', + tag: to.params.tag + } + }); + return true; } },