54 lines
1.1 KiB
Vue
54 lines
1.1 KiB
Vue
<template>
|
|
<!-- <div id="nav">
|
|
<router-link to="/">Home</router-link> |
|
|
<router-link to="/about">About</router-link>
|
|
</div> -->
|
|
<a-config-provider :locale="locale">
|
|
<router-view/>
|
|
</a-config-provider>
|
|
</template>
|
|
<script lang="ts">
|
|
import { defineComponent } from 'vue';
|
|
import router from './router';
|
|
import store from './store';
|
|
import { getValue } from './utils/common';
|
|
import { provideI18n } from "@/utils/i18n"
|
|
import i18ninit from "@/i18n/init"
|
|
import enUS from 'ant-design-vue/es/locale/en_US';
|
|
import zhCN from 'ant-design-vue/es/locale/zh_CN';
|
|
|
|
export default defineComponent({
|
|
setup(){
|
|
console.log(i18ninit)
|
|
provideI18n(i18ninit);
|
|
if(getValue('token')){
|
|
store.commit("login", true)
|
|
store.dispatch("setUserInfo");
|
|
}else{
|
|
router.push("/")
|
|
}
|
|
return{
|
|
locale: zhCN
|
|
}
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
div {
|
|
user-select: none;
|
|
}
|
|
.one-line-hide {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
input::-webkit-outer-spin-button,
|
|
input::-webkit-inner-spin-button {
|
|
-webkit-appearance: none;
|
|
}
|
|
input[type="number"]{
|
|
-moz-appearance: textfield;
|
|
}
|
|
</style>
|