Files
Yi.Framework/Yi.RuoYi.Vue3/src/App.vue

37 lines
797 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<router-view />
</template>
<script setup>
import useSettingsStore from '@/store/modules/settings'
import { handleThemeStyle } from '@/utils/theme'
import useUserStore from '@/store/modules/user'
import { storeToRefs } from 'pinia';
import signalR from '@/utils/signalR'
const {token}=storeToRefs(useUserStore());
onMounted(async () => {
await signalR.init(`main`);
nextTick(() => {
// 初始化主题样式
handleThemeStyle(useSettingsStore().theme)
})
})
//这里还需要监视token的变化重新进行signalr连接
watch(()=>token.value,async (newValue,oldValue)=>{
await signalR.init(`main`);
})
</script>
<style>
.el-form--inline {
.el-form-item {
.el-input, .el-cascader, .el-select, .el-autocomplete {
width: 180px;
}
}
}
</style>