| | |
| | | <router-view /> |
| | | <theme-picker /> |
| | | <!-- <Assistant v-if="routertf" /> --> |
| | | <Assistant |
| | | v-if="Assvite" |
| | | :initial-position="{ x: 50, y: 200 }" |
| | | :auto-hide="false" |
| | | :hide-delay="3000" |
| | | primary-color="#1890ff" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | name: "App", |
| | | components: { |
| | | ThemePicker, |
| | | Assistant: () => import("./components/Assistant"), //异步组件加载方式 |
| | | Assistant: () => import("./components/Assistant"), |
| | | }, |
| | | data() { |
| | | return { |
| | | routers: window.location.href, |
| | | routertf: true, |
| | | Assvite: true, |
| | | }; |
| | | }, |
| | | created() { |
| | | var startIndex = this.routers.indexOf("param5=") + "param5=".length; // 找到第一个字符的位置 |
| | | this.routertf = JSON.parse(this.routers.substring(startIndex)); // 截取从 'param5=' 之后的内容 |
| | | // 初始化判断 |
| | | this.checkAndUpdateAssvite(); |
| | | }, |
| | | watch: { |
| | | // 监听路由变化 |
| | | '$route'(to, from) { |
| | | this.checkAndUpdateAssvite(); |
| | | } |
| | | }, |
| | | methods: { |
| | | checkAndUpdateAssvite() { |
| | | const isLoginPage = window.location.pathname.includes("/login"); |
| | | this.Assvite = !isLoginPage; |
| | | console.log('当前路由:', this.$route.path, '是否登录页:', isLoginPage, '显示悬浮球:', this.Assvite); |
| | | } |
| | | }, |
| | | metaInfo() { |
| | | return { |