模板修改
This commit is contained in:
4
components.d.ts
vendored
4
components.d.ts
vendored
@@ -7,9 +7,9 @@ export {}
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
ElButton: typeof import('element-plus/es')['ElButton']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
Foot: typeof import('./src/components/Foot.vue')['default']
|
||||
Footer: typeof import('./src/components/Footer.vue')['default']
|
||||
Head: typeof import('./src/components/Head.vue')['default']
|
||||
Header: typeof import('./src/components/Header.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
|
||||
1
src/env.d.ts
vendored
1
src/env.d.ts
vendored
@@ -6,3 +6,4 @@ declare module '*.vue' {
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
declare module 'element-plus/dist/locale/zh-cn.mjs';
|
||||
12
src/main.ts
12
src/main.ts
@@ -10,13 +10,17 @@ import { createApp } from 'vue'
|
||||
import router from './router/index' //引入vue-router
|
||||
import App from './App.vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import Footer from '@/components/Footer.vue'
|
||||
import Header from '@/components/Header.vue'
|
||||
import Foot from '@/components/Foot.vue'
|
||||
import Head from '@/components/Head.vue'
|
||||
import ElementPlus from 'element-plus'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import 'element-plus/dist/index.css'
|
||||
import 'normalize.css/normalize.css'
|
||||
// 挂载到app上
|
||||
createApp(App)
|
||||
.use(router)
|
||||
.use(createPinia())
|
||||
.component('Footer', Footer)
|
||||
.component('Header', Header)
|
||||
.use(ElementPlus)
|
||||
.component('Foot', Foot)
|
||||
.component('Head', Head)
|
||||
.mount('#app')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<Header></Header>
|
||||
<Head></Head>
|
||||
<div>根组件{{ store.count }}</div>
|
||||
<Footer></Footer>
|
||||
<Foot></Foot>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
"sourceMap": true,
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"lib": ["esnext", "dom"]
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": ["element-plus/global"]
|
||||
},
|
||||
|
||||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
|
||||
|
||||
Reference in New Issue
Block a user