| | |
| | | <div id="app"> |
| | | <router-view /> |
| | | <theme-picker /> |
| | | <Assistant v-if="routertf" /> |
| | | <!-- <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: this.$route.path.split("/").pop(), |
| | | routertf: true, |
| | | Assvite: true, |
| | | }; |
| | | }, |
| | | created() { |
| | | this.routertf = this.$route.param5; |
| | | console.log(this.routertf); |
| | | if ( |
| | | this.routers == "outsideChainxj" || |
| | | this.routers == "outsideChain" || |
| | | this.routers == "outsideChainwt" |
| | | ) { |
| | | this.routertf = false; |
| | | // 初始化判断 |
| | | 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() { |