feat: 更新
This commit is contained in:
1 parent
96230447e4
commit
1f46e44efc
7 files changed
+88
-19
No files matched your search
+18
-8
@@ -1,15 +1,25 @@
|
|||||||
/* eslint-env node */
|
/* eslint-env node */
|
||||||
require('@rushstack/eslint-patch/modern-module-resolution')
|
require("@rushstack/eslint-patch/modern-module-resolution");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
'extends': [
|
"extends": [
|
||||||
'plugin:vue/vue3-essential',
|
"plugin:vue/vue3-essential",
|
||||||
'eslint:recommended',
|
"eslint:recommended",
|
||||||
'@vue/eslint-config-typescript',
|
"@vue/eslint-config-typescript",
|
||||||
'@vue/eslint-config-prettier/skip-formatting'
|
"@vue/eslint-config-prettier/skip-formatting"
|
||||||
],
|
],
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
ecmaVersion: 'latest'
|
ecmaVersion: "latest"
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
//使用双引号号,否则警告
|
||||||
|
"quotes": ["warn", "double"],
|
||||||
|
//语句强制分号结尾
|
||||||
|
"semi": [2, "always"],
|
||||||
|
//对象字面量项尾不能有逗号
|
||||||
|
"comma-dangle": [2, "never"],
|
||||||
|
//使用全等号,否则警告
|
||||||
|
"eqeqeq": "warn"
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
+9
-7
@@ -17,27 +17,29 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { RouterView } from 'vue-router'
|
import { RouterView } from "vue-router";
|
||||||
import routes from '@/router/routes'
|
import routes from "@/router/routes";
|
||||||
import Layout from './components/Layout.vue'
|
import Layout from "./components/Layout.vue";
|
||||||
import VHeader from './components/VHeader.vue'
|
// import VHeader from './components/VHeader.vue'
|
||||||
import SideMenu from './components/SideMenu.vue'
|
import SideMenu from "./components/SideMenu.vue";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
.app-layout {
|
.app-layout {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
&-sider {
|
&-sider {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-right: 1px solid #eee;
|
border-right: 1px solid #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-menu {
|
&-menu {
|
||||||
padding: 20px 10px;
|
padding: 20px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-content {
|
&-content {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
}
|
}</style>
|
||||||
</style>
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import type { App } from "vue";
|
||||||
|
import VHeader from "./components/VHeader.vue";
|
||||||
|
|
||||||
|
const install = function (app: App) {
|
||||||
|
app.component("VHeader", VHeader)
|
||||||
|
};
|
||||||
|
|
||||||
|
export {
|
||||||
|
install
|
||||||
|
};
|
||||||
+2
-1
@@ -3,12 +3,13 @@ import { createApp } from 'vue'
|
|||||||
import { createPinia } from 'pinia'
|
import { createPinia } from 'pinia'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
|
import { install } from "./installComponents";
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
app.use(createPinia())
|
app.use(createPinia())
|
||||||
app.use(router)
|
app.use(router)
|
||||||
|
install(app)
|
||||||
app.mount('#app')
|
app.mount('#app')
|
||||||
|
|
||||||
console.log("-------", import.meta.env)
|
console.log("-------", import.meta.env)
|
||||||
+23
-3
@@ -2,7 +2,7 @@ const routes = [
|
|||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
name: "app",
|
name: "app",
|
||||||
redirect: "/reactivity",
|
redirect: "/reactivity"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/reactivity",
|
path: "/reactivity",
|
||||||
@@ -59,7 +59,7 @@ const routes = [
|
|||||||
name: "computedAdvan",
|
name: "computedAdvan",
|
||||||
meta: { title: "computed双向绑定" },
|
meta: { title: "computed双向绑定" },
|
||||||
component: () => import("@/views/computed/ComputedAdvan.vue")
|
component: () => import("@/views/computed/ComputedAdvan.vue")
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -103,9 +103,29 @@ const routes = [
|
|||||||
name: "watchStop",
|
name: "watchStop",
|
||||||
meta: { title: "watch停止侦听器" },
|
meta: { title: "watch停止侦听器" },
|
||||||
component: () => import("@/views/watch/WatchStop.vue")
|
component: () => import("@/views/watch/WatchStop.vue")
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/component",
|
||||||
|
name: "component",
|
||||||
|
meta: { title: "组件" },
|
||||||
|
redirect: "/component/global",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "/component/global",
|
||||||
|
name: "globalComponent",
|
||||||
|
meta: { title: "全局组件" },
|
||||||
|
component: () => import("@/views/component/GlobalComponent.vue")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/component/part",
|
||||||
|
name: "partComponent",
|
||||||
|
meta: { title: "局部组件" },
|
||||||
|
component: () => import("@/views/component/PartComponent.vue")
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
export default routes;
|
export default routes;
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<VHeader />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in new issue
Block a user