diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-11-03 20:36:12 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-11-03 20:36:12 +0900 |
| commit | 3c59c6fc9babd6f5e93b9a1eefe98abf69096ce2 (patch) | |
| tree | aac2fc2ec2508f5a3e0284bd065ed98d75da9269 /src/client/ui/_common_ | |
| parent | ヘッダーの戻るボタンがページリロードすると消える問... (diff) | |
| download | misskey-3c59c6fc9babd6f5e93b9a1eefe98abf69096ce2.tar.gz misskey-3c59c6fc9babd6f5e93b9a1eefe98abf69096ce2.tar.bz2 misskey-3c59c6fc9babd6f5e93b9a1eefe98abf69096ce2.zip | |
Refactoring
Diffstat (limited to 'src/client/ui/_common_')
| -rw-r--r-- | src/client/ui/_common_/header.vue | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/client/ui/_common_/header.vue b/src/client/ui/_common_/header.vue index 5d7253c368..13f6420aa8 100644 --- a/src/client/ui/_common_/header.vue +++ b/src/client/ui/_common_/header.vue @@ -5,12 +5,20 @@ </transition> <template v-if="info"> <div class="titleContainer"> - <div class="title" v-for="header in info.header" :key="header.id" :class="{ _button: header.onClick, selected: header.selected }" @click="header.onClick" v-tooltip="header.tooltip"> - <Fa v-if="header.icon" :icon="header.icon" :key="header.icon" class="icon"/> - <MkAvatar v-else-if="header.avatar" class="avatar" :user="header.avatar" :disable-preview="true"/> - <span v-if="header.title" class="text">{{ header.title }}</span> - <MkUserName v-else-if="header.userName" :user="header.userName" :nowrap="false" class="text"/> - </div> + <template v-if="info.tabs"> + <div class="title" v-for="tab in info.tabs" :key="tab.id" :class="{ _button: tab.onClick, selected: tab.selected }" @click="tab.onClick" v-tooltip="tab.tooltip"> + <Fa v-if="tab.icon" :icon="tab.icon" :key="tab.icon" class="icon"/> + <span v-if="tab.title" class="text">{{ tab.title }}</span> + </div> + </template> + <template v-else> + <div class="title"> + <Fa v-if="info.icon" :icon="info.icon" :key="info.icon" class="icon"/> + <MkAvatar v-else-if="info.avatar" class="avatar" :user="info.avatar" :disable-preview="true"/> + <span v-if="info.title" class="text">{{ info.title }}</span> + <MkUserName v-else-if="info.userName" :user="info.userName" :nowrap="false" class="text"/> + </div> + </template> </div> <button class="_button action" v-if="info.action" @click="info.action.handler"><Fa :icon="info.action.icon" :key="info.action.icon"/></button> </template> |