1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-06 02:38:11 +09:00
This commit is contained in:
syuilo 2018-06-06 03:12:06 +09:00
parent d8cd24fab0
commit 8ca58de2ba
2 changed files with 41 additions and 18 deletions

View File

@ -1,10 +1,12 @@
<template> <template>
<mk-ui :class="$style.root"> <mk-ui :class="$style.root">
<div class="qlvquzbjribqcaozciifydkngcwtyzje"> <div class="qlvquzbjribqcaozciifydkngcwtyzje">
<x-tl-column src="home"/> <template v-for="column in columns">
<x-notifications-column/> <x-notifications-column v-if="column.type == 'notifications'" :key="column.id"/>
<x-tl-column src="local"/> <x-tl-column v-if="column.type == 'home'" :key="column.id" src="home"/>
<x-tl-column src="global"/> <x-tl-column v-if="column.type == 'local'" :key="column.id" src="local"/>
<x-tl-column v-if="column.type == 'global'" :key="column.id" src="global"/>
</template>
</div> </div>
</mk-ui> </mk-ui>
</template> </template>
@ -13,11 +15,45 @@
import Vue from 'vue'; import Vue from 'vue';
import XTlColumn from './deck.tl-column.vue'; import XTlColumn from './deck.tl-column.vue';
import XNotificationsColumn from './deck.notifications-column.vue'; import XNotificationsColumn from './deck.notifications-column.vue';
import * as uuid from 'uuid';
export default Vue.extend({ export default Vue.extend({
components: { components: {
XTlColumn, XTlColumn,
XNotificationsColumn XNotificationsColumn
},
computed: {
columns() {
if (this.$store.state.settings.deck == null) return [];
return this.$store.state.settings.deck.columns;
}
},
created() {
if (this.$store.state.settings.deck == null) {
const deck = {
columns: [/*{
type: 'widgets',
widgets: []
}, */{
id: uuid(),
type: 'home'
}, {
id: uuid(),
type: 'notifications'
}, {
id: uuid(),
type: 'local'
}, {
id: uuid(),
type: 'global'
}]
};
this.$store.dispatch('settings/set', {
key: 'deck',
value: deck
});
}
} }
}); });
</script> </script>

View File

@ -7,20 +7,7 @@ import { hostname } from './config';
const defaultSettings = { const defaultSettings = {
home: null, home: null,
mobileHome: [], mobileHome: [],
deck: { deck: null,
columns: [/*{
type: 'widgets',
widgets: []
}, */{
type: 'home'
}, {
type: 'notifications'
}, {
type: 'local'
}, {
type: 'global'
}]
},
fetchOnScroll: true, fetchOnScroll: true,
showMaps: true, showMaps: true,
showPostFormOnTopOfTl: false, showPostFormOnTopOfTl: false,