From 135e39f7655ce9ce7a59f7988e6abebf3fbc64ec Mon Sep 17 00:00:00 2001
From: chuan_wuhao <443547225@qq.com>
Date: Thu, 17 Nov 2022 16:21:33 +0800
Subject: [PATCH] inti
---
src/App.tsx | 36 ++++++++----------------------------
src/main.ts | 35 +++++++++++++++++++++++++++++------
src/router/modules/demo.ts | 5 -----
src/router/modules/index.ts | 5 -----
src/router/routes.ts | 10 +++++++---
src/types/index.d.ts | 26 ++++++++++++++++++++++++++
vite.config.ts | 4 +++-
7 files changed, 73 insertions(+), 48 deletions(-)
delete mode 100644 src/router/modules/demo.ts
delete mode 100644 src/router/modules/index.ts
diff --git a/src/App.tsx b/src/App.tsx
index 2da64ec3..794720b1 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,22 +1,18 @@
import { defineComponent } from 'vue'
-import RayTransitionComponent from '@/components/RayTransitionComponent/index.vue' // 以封装动画路由组件
-import DraggableComponent from '@/components/DraggableComponent/index.vue'
-import RayScrollReveal from '@/components/RayScrollReveal/index'
-import R from '@/icons/ray.svg' // 使用 vite-svg-loader 作为 svg 使用插件, 故而不需要使用 RayIcon 作为组件引入
-import RayIcon from '@/components/RayIcon/index'
const App = defineComponent({
name: 'App',
setup() {
- const { x, y } = useMouse()
const { height: windowHeight } = useWindowSize()
- const { t } = useI18n()
+ const numRef = ref(1)
+
+ window?.$wujie?.bus.$on('addState', (val: number) => {
+ numRef.value += val
+ })
return {
- x,
- y,
windowHeight,
- ray: t,
+ numRef,
}
},
render() {
@@ -25,24 +21,8 @@ const App = defineComponent({
class="app-wrapper"
style={`height: ${this.windowHeight}px;font-size: 22px; color: #FDD192;padding: 20px;`}
>
- 组件形式使用 svg:
- icon componet 形式使用 svg:
- hello! Welcome to this template!
-
这个页面是保持激活状态
+当前计数: {this.numRef}
) }, diff --git a/src/main.ts b/src/main.ts index 0131496a..0c947241 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,7 @@ import { createApp } from 'vue' +import type { App as AppType } from 'vue' + import '@/styles/base.scss' // import 'amfe-flexible' // 如果为移动端项目, 解开该注释即可 @@ -12,15 +14,36 @@ import { setupStore } from './store/index' import { setupI18n } from './language/index' const setupTemplate = () => { - const app = createApp(App) + const instance = createApp(App) - setupRouter(app) + setupRouter(instance) - setupStore(app) + setupStore(instance) - setupI18n(app) + setupI18n(instance) - app.mount('#app') + instance.mount('#app') } -setupTemplate() +if (window.__POWERED_BY_WUJIE__) { + let instance: AppType