refs #3301 Rewrite Preferences with composition API
This commit is contained in:
parent
050b1d4cf6
commit
225ab4a56f
|
@ -54,26 +54,34 @@
|
||||||
</el-container>
|
</el-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
import { mapState } from 'vuex'
|
import { defineComponent, computed } from 'vue'
|
||||||
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
|
import { useStore } from '@/store'
|
||||||
|
|
||||||
export default {
|
export default defineComponent({
|
||||||
name: 'preferences',
|
name: 'preferences',
|
||||||
computed: {
|
setup() {
|
||||||
...mapState({
|
const store = useStore()
|
||||||
primaryColor: state => state.App.theme.primary_color,
|
const router = useRouter()
|
||||||
backgroundColor: state => state.App.theme.background_color
|
const route = useRoute()
|
||||||
})
|
|
||||||
},
|
const primaryColor = computed(() => store.state.App.theme.primary_color)
|
||||||
methods: {
|
const backgroundColor = computed(() => store.state.App.theme.background_color)
|
||||||
close() {
|
|
||||||
this.$router.push({ path: '/', query: { redirect: 'home' } })
|
const close = () => {
|
||||||
},
|
router.push({ path: '/', query: { redirect: 'home' } })
|
||||||
activeRoute() {
|
}
|
||||||
return this.$route.path
|
const activeRoute = () => route.path
|
||||||
|
|
||||||
|
return {
|
||||||
|
primaryColor,
|
||||||
|
backgroundColor,
|
||||||
|
close,
|
||||||
|
activeRoute
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Loading…
Reference in New Issue