feat: add
This commit is contained in:
parent
33eac0717a
commit
615db05a03
27
src/main.ts
27
src/main.ts
@ -6,6 +6,19 @@ import 'element-plus/dist/index.css'
|
||||
//导入element-plus的中文语言包
|
||||
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
||||
|
||||
//svg插件需要配置代码
|
||||
import 'virtual:svg-icons-register'
|
||||
|
||||
//引入自定义插件对象,注册整个项目全局组件
|
||||
import gloabalComponents from '@/components'
|
||||
|
||||
|
||||
//引入模板的全局样式
|
||||
import '@/styles/index.scss'
|
||||
|
||||
// 引入路由器
|
||||
import router from '@/router'
|
||||
|
||||
//获取APP实例
|
||||
const app = createApp(App)
|
||||
//使用element-plus插件
|
||||
@ -13,19 +26,11 @@ app.use(ElementPlus, {
|
||||
locale: zhCn, //设置语言为中文国际化
|
||||
})
|
||||
|
||||
//svg插件需要配置代码
|
||||
import 'virtual:svg-icons-register'
|
||||
|
||||
//引入自定义插件对象,注册整个项目全局组件
|
||||
import gloabalComponents from '@/components'
|
||||
//console.log('gloabalComponents:', gloabalComponents) //输出插件对象
|
||||
|
||||
//使用自定义插件对象
|
||||
//使用自定义插件
|
||||
app.use(gloabalComponents)
|
||||
|
||||
//console.log('当前环境:', import.meta.env) //输出当前环境
|
||||
//注册路由
|
||||
app.use(router)
|
||||
|
||||
//引入模板的全局样式
|
||||
import '@/styles/index.scss'
|
||||
//挂载APP实例到#app元素上
|
||||
app.mount('#app')
|
||||
|
@ -6,6 +6,13 @@ let router = createRouter({
|
||||
//路由模式hash
|
||||
history: createWebHashHistory(),
|
||||
routes: constantRoute, //路由表
|
||||
//滚动行为
|
||||
scrollBehavior(){
|
||||
return{
|
||||
left: 0,
|
||||
top: 0
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export default router
|
||||
|
Loading…
x
Reference in New Issue
Block a user