misskey/src/client/root.vue

53 lines
975 B
Vue
Raw Normal View History

2020-07-21 15:38:17 +00:00
<template>
2020-07-24 02:59:26 +00:00
<DeckUI v-if="deckmode"/>
<DefaultUI v-else/>
2020-07-23 04:02:46 +00:00
<!-- Render modals here -->
2020-07-21 15:38:17 +00:00
</template>
<script lang="ts">
2020-07-23 18:15:32 +00:00
import { defineComponent } from 'vue';
2020-07-21 15:38:17 +00:00
import DefaultUI from './default.vue';
import DeckUI from './deck.vue';
2020-07-23 14:39:15 +00:00
import { instanceName, deckmode } from './config';
2020-07-21 15:38:17 +00:00
2020-07-23 18:15:32 +00:00
export default defineComponent({
2020-07-21 15:38:17 +00:00
components: {
DefaultUI,
DeckUI,
},
2020-07-23 04:02:46 +00:00
metaInfo: {
title: null,
titleTemplate: title => title ? `${title} | ${(instanceName || 'Misskey')}` : (instanceName || 'Misskey')
},
2020-07-24 02:59:26 +00:00
props: {
2020-07-24 07:30:55 +00:00
// TODO: propで渡すとvueによって無駄なobserveがされるのでどうにかする
2020-07-24 02:59:26 +00:00
stream: {
},
isMobile: {
type: Boolean,
required: false,
default: false,
}
},
2020-07-21 15:38:17 +00:00
data() {
return {
2020-07-24 02:59:26 +00:00
deckmode
2020-07-21 15:38:17 +00:00
};
},
methods: {
2020-07-24 10:35:19 +00:00
api(endpoint: string, data: { [x: string]: any } = {}, token?) {
return this.$store.dispatch('api', { endpoint, data, token });
},
2020-07-21 15:38:17 +00:00
dialog(opts) {
2020-07-23 04:02:46 +00:00
this.$store.commit('showDialog', opts);
2020-07-21 15:38:17 +00:00
}
}
});
</script>