Use v-slot instead of slot

This commit is contained in:
syuilo 2019-02-18 09:48:00 +09:00
parent ba1492f977
commit 54d40420ad
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
96 changed files with 291 additions and 283 deletions

View file

@ -1,8 +1,8 @@
<template>
<div class="mk-activity">
<ui-container :show-header="design == 0" :naked="design == 2">
<template slot="header"><fa icon="chart-bar"/>{{ $t('title') }}</template>
<button slot="func" :title="$t('toggle')" @click="toggle"><fa icon="sort"/></button>
<template v-slot:header><fa icon="chart-bar"/>{{ $t('title') }}</template>
<template v-slot:func><button :title="$t('toggle')" @click="toggle"><fa icon="sort"/></button></template>
<p :class="$style.fetching" v-if="fetching"><fa icon="spinner" pulse fixed-width/>{{ $t('@.loading') }}<mk-ellipsis/></p>
<template v-else>

View file

@ -1,9 +1,11 @@
<template>
<mk-window ref="window" is-modal width="800px" height="500px" @closed="destroyDom">
<span slot="header" class="jqiaciqv">
<span class="title">{{ $t('choose-prompt') }}</span>
<span class="count" v-if="multiple && files.length > 0">({{ $t('chosen-files', { count: files.length }) }})</span>
</span>
<template v-slot:header>
<span class="jqiaciqv">
<span class="title">{{ $t('choose-prompt') }}</span>
<span class="count" v-if="multiple && files.length > 0">({{ $t('chosen-files', { count: files.length }) }})</span>
</span>
</template>
<div class="rqsvbumu">
<x-drive

View file

@ -1,8 +1,8 @@
<template>
<mk-window ref="window" is-modal width="800px" height="500px" @closed="destroyDom">
<span slot="header">
<template v-slot:header>
<span>{{ $t('choose-prompt') }}</span>
</span>
</template>
<div class="hllkpxxu">
<x-drive

View file

@ -1,6 +1,6 @@
<template>
<mk-window ref="window" is-modal width="800px" :can-close="false">
<span slot="header"><fa icon="crop"/>{{ title }}</span>
<template v-slot:header><fa icon="crop"/>{{ title }}</template>
<div class="body">
<vue-cropper ref="cropper"
:src="image.url"

View file

@ -1,6 +1,6 @@
<template>
<mk-window ref="window" @closed="destroyDom" width="800px" height="500px" :popout-url="popout">
<template slot="header">
<template v-slot:header>
<p v-if="usage" :class="$style.info"><b>{{ usage.toFixed(1) }}%</b> {{ $t('used') }}</p>
<span :class="$style.title"><fa icon="cloud"/>{{ $t('@.drive') }}</span>
</template>

View file

@ -1,6 +1,6 @@
<template>
<mk-window ref="window" width="500px" height="560px" :popout-url="popout" @closed="destroyDom">
<span slot="header" :class="$style.header"><fa icon="gamepad"/>{{ $t('game') }}</span>
<template v-slot:header><fa icon="gamepad"/> {{ $t('game') }}</template>
<x-reversi :class="$style.content" @gamed="g => game = g"/>
</mk-window>
</template>
@ -31,10 +31,6 @@ export default Vue.extend({
</script>
<style lang="stylus" module>
.header
> [data-icon]
margin-right 4px
.content
height 100%
overflow auto

View file

@ -1,6 +1,6 @@
<template>
<mk-window ref="window" width="500px" height="560px" :popout-url="popout" @closed="destroyDom">
<span slot="header" :class="$style.header"><fa icon="comments"/>{{ $t('title') }} <mk-user-name :user="user"/></span>
<template v-slot:header><fa icon="comments"/> {{ $t('title') }} <mk-user-name :user="user"/></template>
<x-messaging-room :user="user" :class="$style.content"/>
</mk-window>
</template>
@ -26,10 +26,6 @@ export default Vue.extend({
</script>
<style lang="stylus" module>
.header
> [data-icon]
margin-right 4px
.content
height 100%
overflow auto

View file

@ -1,6 +1,6 @@
<template>
<mk-window ref="window" width="500px" height="560px" @closed="destroyDom">
<span slot="header" :class="$style.header"><fa icon="comments"/>{{ $t('title') }}</span>
<template v-slot:header :class="$style.header"><fa icon="comments"/>{{ $t('title') }}</template>
<x-messaging :class="$style.content" @navigate="navigate"/>
</mk-window>
</template>

View file

@ -1,12 +1,14 @@
<template>
<mk-window class="mk-post-form-window" ref="window" is-modal @closed="onWindowClosed" :animation="animation">
<span slot="header" class="mk-post-form-window--header">
<span class="icon" v-if="geo"><fa icon="map-marker-alt"/></span>
<span v-if="!reply">{{ $t('note') }}</span>
<span v-if="reply">{{ $t('reply') }}</span>
<span class="count" v-if="files.length != 0">{{ this.$t('attaches').replace('{}', files.length) }}</span>
<span class="count" v-if="uploadings.length != 0">{{ this.$t('uploading-media').replace('{}', uploadings.length) }}<mk-ellipsis/></span>
</span>
<template v-slot:header>
<span class="mk-post-form-window--header">
<span class="icon" v-if="geo"><fa icon="map-marker-alt"/></span>
<span v-if="!reply">{{ $t('note') }}</span>
<span v-if="reply">{{ $t('reply') }}</span>
<span class="count" v-if="files.length != 0">{{ this.$t('attaches').replace('{}', files.length) }}</span>
<span class="count" v-if="uploadings.length != 0">{{ this.$t('uploading-media').replace('{}', uploadings.length) }}<mk-ellipsis/></span>
</span>
</template>
<div class="mk-post-form-window--body">
<mk-note-preview v-if="reply" class="notePreview" :note="reply"/>

View file

@ -1,6 +1,6 @@
<template>
<mk-window ref="window" :is-modal="false" :can-close="false" width="500px" @closed="destroyDom">
<span slot="header">{{ title }}<mk-ellipsis/></span>
<template v-slot:header>{{ title }}<mk-ellipsis/></template>
<div :class="$style.body">
<p :class="$style.init" v-if="isNaN(value)">{{ $t('waiting') }}<mk-ellipsis/></p>
<p :class="$style.percentage" v-if="!isNaN(value)">{{ Math.floor((value / max) * 100) }}</p>

View file

@ -1,6 +1,6 @@
<template>
<mk-window ref="window" is-modal width="450px" height="500px" @closed="destroyDom">
<span slot="header"><fa :icon="['far', 'envelope']"/> {{ $t('title') }}</span>
<template v-slot:header><fa :icon="['far', 'envelope']"/> {{ $t('title') }}</template>
<div class="slpqaxdoxhvglersgjukmvizkqbmbokc">
<div v-for="req in requests">

View file

@ -1,6 +1,6 @@
<template>
<mk-window ref="window" is-modal @closed="onWindowClosed" :animation="animation">
<span slot="header" :class="$style.header"><fa icon="retweet"/>{{ $t('title') }}</span>
<template v-slot:header :class="$style.header"><fa icon="retweet"/>{{ $t('title') }}</template>
<mk-renote-form ref="form" :note="note" @posted="onPosted" @canceled="onCanceled" v-hotkey.global="keymap"/>
</mk-window>
</template>

View file

@ -1,6 +1,6 @@
<template>
<mk-window ref="window" is-modal width="700px" height="550px" @closed="destroyDom">
<span slot="header" :class="$style.header"><fa icon="cog"/>{{ $t('settings') }}</span>
<template v-slot:header :class="$style.header"><fa icon="cog"/>{{ $t('settings') }}</template>
<x-settings :initial-page="initialPage" @done="close"/>
</mk-window>
</template>

View file

@ -22,17 +22,17 @@
<x-theme class="theme" v-show="page == 'theme'"/>
<ui-card class="web" v-show="page == 'web'">
<div slot="title"><fa icon="sliders-h"/> {{ $t('behaviour') }}</div>
<template v-slot:title><fa icon="sliders-h"/> {{ $t('behaviour') }}</template>
<section>
<ui-switch v-model="fetchOnScroll">{{ $t('fetch-on-scroll') }}
<span slot="desc">{{ $t('fetch-on-scroll-desc') }}</span>
<template v-slot:desc>{{ $t('fetch-on-scroll-desc') }}</template>
</ui-switch>
<ui-switch v-model="autoPopout">{{ $t('auto-popout') }}
<span slot="desc">{{ $t('auto-popout-desc') }}</span>
<template v-slot:desc>{{ $t('auto-popout-desc') }}</template>
</ui-switch>
<ui-switch v-model="keepCw">{{ $t('keep-cw') }}
<span slot="desc">{{ $t('keep-cw-desc') }}</span>
<template v-slot:desc>{{ $t('keep-cw-desc') }}</template>
</ui-switch>
</section>
@ -62,12 +62,12 @@
<section>
<header>{{ $t('web-search-engine') }}</header>
<ui-input v-model="webSearchEngine">{{ $t('web-search-engine') }}<span slot="desc">{{ $t('web-search-engine-desc') }}</span></ui-input>
<ui-input v-model="webSearchEngine">{{ $t('web-search-engine') }}<template v-slot:desc>{{ $t('web-search-engine-desc') }}</template></ui-input>
</section>
</ui-card>
<ui-card class="web" v-show="page == 'web'">
<div slot="title"><fa icon="desktop"/> {{ $t('display') }}</div>
<template v-slot:title><fa icon="desktop"/> {{ $t('display') }}</template>
<section>
<ui-switch v-model="showPostFormOnTopOfTl">{{ $t('post-form-on-timeline') }}</ui-switch>
@ -135,11 +135,11 @@
</ui-card>
<ui-card class="web" v-show="page == 'web'">
<div slot="title"><fa icon="volume-up"/> {{ $t('sound') }}</div>
<template v-slot:title><fa icon="volume-up"/> {{ $t('sound') }}</template>
<section>
<ui-switch v-model="enableSounds">{{ $t('enable-sounds') }}
<span slot="desc">{{ $t('enable-sounds-desc') }}</span>
<template v-slot:desc>{{ $t('enable-sounds-desc') }}</template>
</ui-switch>
<label>{{ $t('volume') }}</label>
<input type="range"
@ -155,7 +155,7 @@
<x-language-settings v-show="page == 'web'"/>
<ui-card class="web" v-show="page == 'web'">
<div slot="title"><fa :icon="['far', 'trash-alt']"/> {{ $t('cache') }}</div>
<template v-slot:title><fa :icon="['far', 'trash-alt']"/> {{ $t('cache') }}</template>
<section>
<ui-button @click="clean">{{ $t('clean-cache') }}</ui-button>
<div class="none ui info warn">
@ -171,7 +171,7 @@
</div>
<ui-card class="hashtags" v-show="page == 'hashtags'">
<div slot="title"><fa icon="hashtag"/> {{ $t('tags') }}</div>
<template v-slot:title><fa icon="hashtag"/> {{ $t('tags') }}</template>
<section>
<x-tags/>
</section>
@ -182,28 +182,28 @@
</div>
<ui-card class="apps" v-show="page == 'apps'">
<div slot="title"><fa icon="puzzle-piece"/> {{ $t('apps') }}</div>
<template v-slot:title><fa icon="puzzle-piece"/> {{ $t('apps') }}</template>
<section>
<x-apps/>
</section>
</ui-card>
<ui-card class="password" v-show="page == 'security'">
<div slot="title"><fa icon="unlock-alt"/> {{ $t('password') }}</div>
<template v-slot:title><fa icon="unlock-alt"/> {{ $t('password') }}</template>
<section>
<x-password-settings/>
</section>
</ui-card>
<ui-card class="2fa" v-show="page == 'security'">
<div slot="title"><fa icon="mobile-alt"/> {{ $t('@.2fa') }}</div>
<template v-slot:title><fa icon="mobile-alt"/> {{ $t('@.2fa') }}</template>
<section>
<x-2fa/>
</section>
</ui-card>
<ui-card class="signin" v-show="page == 'security'">
<div slot="title"><fa icon="sign-in-alt"/> {{ $t('signin') }}</div>
<template v-slot:title><fa icon="sign-in-alt"/> {{ $t('signin') }}</template>
<section>
<x-signins/>
</section>
@ -214,14 +214,14 @@
</div>
<ui-card class="other" v-show="page == 'other'">
<div slot="title"><fa icon="info-circle"/> {{ $t('about') }}</div>
<template v-slot:title><fa icon="info-circle"/> {{ $t('about') }}</template>
<section>
<p v-if="meta">{{ $t('operator') }}: <i><a :href="'mailto:' + meta.maintainer.email" target="_blank">{{ meta.maintainer.name }}</a></i></p>
</section>
</ui-card>
<ui-card class="other" v-show="page == 'other'">
<div slot="title"><fa icon="sync-alt"/> {{ $t('update') }}</div>
<template v-slot:title><fa icon="sync-alt"/> {{ $t('update') }}</template>
<section>
<p>
<span>{{ $t('version') }} <i>{{ version }}</i></span>
@ -237,20 +237,20 @@
<details>
<summary>{{ $t('update-settings') }}</summary>
<ui-switch v-model="preventUpdate">
{{ $t('prevent-update') }}<span slot="desc">{{ $t('prevent-update-desc') }}</span>
{{ $t('prevent-update') }}<template v-slot:desc>{{ $t('prevent-update-desc') }}</template>
</ui-switch>
</details>
</section>
</ui-card>
<ui-card class="other" v-show="page == 'other'">
<div slot="title"><fa icon="cogs"/> {{ $t('advanced-settings') }}</div>
<template v-slot:title><fa icon="cogs"/> {{ $t('advanced-settings') }}</template>
<section>
<ui-switch v-model="debug">
{{ $t('debug-mode') }}<span slot="desc">{{ $t('debug-mode-desc') }}</span>
{{ $t('debug-mode') }}<template v-slot:desc>{{ $t('debug-mode-desc') }}</template>
</ui-switch>
<ui-switch v-model="enableExperimentalFeatures">
{{ $t('experimental') }}<span slot="desc">{{ $t('experimental-desc') }}</span>
{{ $t('experimental') }}<template v-slot:desc>{{ $t('experimental-desc') }}</template>
</ui-switch>
</section>
</ui-card>

View file

@ -1,7 +1,7 @@
<template>
<div>
<mk-notes ref="timeline" :make-promise="makePromise" @inited="() => $emit('loaded')">
<template slot="header">
<template v-slot:header>
<slot></slot>
</template>
</mk-notes>

View file

@ -1,6 +1,6 @@
<template>
<mk-window ref="window" width="450px" height="500px" @closed="destroyDom">
<span slot="header"><fa icon="list"/> {{ list.title }}</span>
<template v-slot:header><fa icon="list"/> {{ list.title }}</template>
<x-editor :list="list"/>
</mk-window>

View file

@ -1,6 +1,6 @@
<template>
<mk-window ref="window" width="450px" height="500px" @closed="destroyDom">
<span slot="header"><fa icon="list"/> {{ $t('title') }}</span>
<template v-slot:header><fa icon="list"/> {{ $t('title') }}</template>
<div class="xkxvokkjlptzyewouewmceqcxhpgzprp">
<button class="ui" @click="add">{{ $t('create-list') }}</button>