This commit is contained in:
Pan 2019-04-02 17:52:57 +08:00
parent 3145f91f32
commit 3773a8a106
6 changed files with 1 additions and 38 deletions

View File

@ -37,15 +37,9 @@ export default {
computed: { computed: {
routes() { routes() {
return this.$store.getters.permission_routes return this.$store.getters.permission_routes
},
lang() {
return this.$store.getters.language
} }
}, },
watch: { watch: {
lang() {
this.searchPool = this.generateRoutes(this.routes)
},
routes() { routes() {
this.searchPool = this.generateRoutes(this.routes) this.searchPool = this.generateRoutes(this.routes)
}, },

View File

@ -55,21 +55,12 @@ export default {
} }
} }
}, },
computed: {
language() {
return this.languageTypeList[this.$store.getters.language]
}
},
watch: { watch: {
value(val) { value(val) {
if (!this.hasChange && this.hasInit) { if (!this.hasChange && this.hasInit) {
this.$nextTick(() => this.$nextTick(() =>
window.tinymce.get(this.tinymceId).setContent(val || '')) window.tinymce.get(this.tinymceId).setContent(val || ''))
} }
},
language() {
this.destroyTinymce()
this.$nextTick(() => this.initTinymce())
} }
}, },
mounted() { mounted() {
@ -88,7 +79,6 @@ export default {
initTinymce() { initTinymce() {
const _this = this const _this = this
window.tinymce.init({ window.tinymce.init({
language: this.language,
selector: `#${this.tinymceId}`, selector: `#${this.tinymceId}`,
height: this.height, height: this.height,
body_class: 'panel-body ', body_class: 'panel-body ',

View File

@ -1,6 +1,5 @@
const getters = { const getters = {
sidebar: state => state.app.sidebar, sidebar: state => state.app.sidebar,
language: state => state.app.language,
size: state => state.app.size, size: state => state.app.size,
device: state => state.app.device, device: state => state.app.device,
visitedViews: state => state.tagsView.visitedViews, visitedViews: state => state.tagsView.visitedViews,

View File

@ -6,7 +6,6 @@ const state = {
withoutAnimation: false withoutAnimation: false
}, },
device: 'desktop', device: 'desktop',
language: Cookies.get('language') || 'en',
size: Cookies.get('size') || 'medium' size: Cookies.get('size') || 'medium'
} }
@ -28,10 +27,6 @@ const mutations = {
TOGGLE_DEVICE: (state, device) => { TOGGLE_DEVICE: (state, device) => {
state.device = device state.device = device
}, },
SET_LANGUAGE: (state, language) => {
state.language = language
Cookies.set('language', language)
},
SET_SIZE: (state, size) => { SET_SIZE: (state, size) => {
state.size = size state.size = size
Cookies.set('size', size) Cookies.set('size', size)
@ -48,9 +43,6 @@ const actions = {
toggleDevice({ commit }, device) { toggleDevice({ commit }, device) {
commit('TOGGLE_DEVICE', device) commit('TOGGLE_DEVICE', device)
}, },
setLanguage({ commit }, language) {
commit('SET_LANGUAGE', language)
},
setSize({ commit }, size) { setSize({ commit }, size) {
commit('SET_SIZE', size) commit('SET_SIZE', size)
} }

View File

@ -1,12 +0,0 @@
// translate router.meta.title, be used in breadcrumb sidebar tagsview
export function generateTitle(title) {
const hasKey = this.$te('route.' + title)
if (hasKey) {
// $t :this method from vue-i18n, inject in @/lang/index.js
const translatedTitle = this.$t('route.' + title)
return translatedTitle
}
return title
}

View File

@ -79,7 +79,7 @@ export default {
}, },
computed: { computed: {
language() { language() {
return this.languageTypeList[this.$store.getters.language] return this.languageTypeList['en']
} }
}, },
methods: { methods: {