添加全局样式和 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 }

View File

@@ -10,9 +10,11 @@ declare module 'product/ProductDomain' {
stock: number;
categoryId: number;
}
// 应用服务类型
// 应用服务类型
export class ProductApplicationService {
constructor(repo: ProductRepository);
findAll(): Promise<Array<any>>; // TODO any 需要修改
findById(id: number): Promise<Product>
}
@@ -39,6 +41,4 @@ declare module 'product/ProductRouter' {
export const productRouter: RouteRecordRaw[];
}
declare module 'shared/utils' {
export const UrlCheckUtils: any;
}

View File

@@ -0,0 +1,20 @@
declare module 'shared/utils' {
export const UrlCheckUtils: any;
}
declare module 'shared/element-plus' {
import { App } from "vue";
export {
ElButton,
ElInput,
ElTable,
ElMessage
// 添加其他组件
} from 'element-plus';
export const initElement: (app: App) => void;
export default any;
}
declare module 'shared/normalize' {
export const init: () => void;
}