添加全局样式和 element ui框架

This commit is contained in:
编码猿
2025-09-24 23:56:55 +08:00
parent 21bf47c8a1
commit 537c7ca60e
37 changed files with 385486 additions and 8374 deletions

View File

@@ -1,25 +1,22 @@
// import './assets/main.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App'
import router from './router'
import { init } from "shared/normalize";
import element from "shared/element-plus";
// import { getNacosInstance } from '@shared/lib/nacosInstance';
class Main {
constructor() {
createApp(App)
.use(createPinia())
.use(router)
.mount('#app')
const app = createApp(App)
// this.test()
}
app.use(createPinia())
.use(router)
.mount('#app')
async test() {
// 关键通过getNacosInstance获取实例确保已初始化
const nacos = await getNacosInstance();
console.log("product: ", await nacos.find('app-product'))
app.use(element)
init()
}
}

View File

@@ -1,6 +1,7 @@
import { Component, Ref, Setup, Vue } from 'vue-facing-decorator'
import Header from '../components/Header'
import { RouteLocationNormalizedLoaded, Router, useRoute, useRouter } from "vue-router";
import { ElButton, SearchIcon } from "shared/element-plus";
interface ListItemType {
id: number
@@ -49,6 +50,7 @@ export default class Home extends Vue {
return (
<div class="home">
<h1 ref="refH1"></h1>
<ElButton type="primary" icon={ SearchIcon }></ElButton>
<p onClick={ this.addCount }>counter { this.counter }</p>
<Header
list={ this.newList }