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 */
|
||||
require('@rushstack/eslint-patch/modern-module-resolution')
|
||||
require("@rushstack/eslint-patch/modern-module-resolution");
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
'extends': [
|
||||
'plugin:vue/vue3-essential',
|
||||
'eslint:recommended',
|
||||
'@vue/eslint-config-typescript',
|
||||
'@vue/eslint-config-prettier/skip-formatting'
|
||||
"extends": [
|
||||
"plugin:vue/vue3-essential",
|
||||
"eslint:recommended",
|
||||
"@vue/eslint-config-typescript",
|
||||
"@vue/eslint-config-prettier/skip-formatting"
|
||||
],
|
||||
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>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { RouterView } from 'vue-router'
|
||||
import routes from '@/router/routes'
|
||||
import Layout from './components/Layout.vue'
|
||||
import VHeader from './components/VHeader.vue'
|
||||
import SideMenu from './components/SideMenu.vue'
|
||||
import { RouterView } from "vue-router";
|
||||
import routes from "@/router/routes";
|
||||
import Layout from "./components/Layout.vue";
|
||||
// import VHeader from './components/VHeader.vue'
|
||||
import SideMenu from "./components/SideMenu.vue";
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.app-layout {
|
||||
height: 100%;
|
||||
|
||||
&-sider {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
|
||||
&-menu {
|
||||
padding: 20px 10px;
|
||||
}
|
||||
|
||||
&-content {
|
||||
padding: 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 App from './App.vue'
|
||||
import router from './router'
|
||||
import { install } from "./installComponents";
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
app.use(createPinia())
|
||||
app.use(router)
|
||||
|
||||
install(app)
|
||||
app.mount('#app')
|
||||
|
||||
console.log("-------", import.meta.env)
|
||||
+23
-3
@@ -2,7 +2,7 @@ const routes = [
|
||||
{
|
||||
path: "/",
|
||||
name: "app",
|
||||
redirect: "/reactivity",
|
||||
redirect: "/reactivity"
|
||||
},
|
||||
{
|
||||
path: "/reactivity",
|
||||
@@ -59,7 +59,7 @@ const routes = [
|
||||
name: "computedAdvan",
|
||||
meta: { title: "computed双向绑定" },
|
||||
component: () => import("@/views/computed/ComputedAdvan.vue")
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -103,9 +103,29 @@ const routes = [
|
||||
name: "watchStop",
|
||||
meta: { title: "watch停止侦听器" },
|
||||
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;
|
||||
@@ -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