添加全局样式和 element ui框架
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user