mirror of
https://github.com/sahadev/vue-component-creater-ui.git
synced 2026-03-03 11:30:48 +08:00
update: 合并antd
This commit is contained in:
19
src/libs/UIComponentInit.js
Normal file
19
src/libs/UIComponentInit.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// 其它UI组件库应该在这里集成
|
||||
function loadVant() {
|
||||
const vantLoadPromise = (() => import("vant"))();
|
||||
(() => import("vant/lib/index.css"))();
|
||||
vantLoadPromise.then((vantModule) => {
|
||||
self.globalApp.use(vantModule);
|
||||
});
|
||||
}
|
||||
|
||||
function loadAntD() {
|
||||
const vantLoadPromise = (() => import("ant-design-vue"))();
|
||||
(() => import("ant-design-vue/dist/antd.css"))();
|
||||
vantLoadPromise.then((vantModule) => {
|
||||
self.globalApp.use(vantModule);
|
||||
});
|
||||
}
|
||||
|
||||
loadAntD();
|
||||
loadVant();
|
||||
17
src/main.js
17
src/main.js
@@ -8,17 +8,13 @@ import {
|
||||
Refresh,
|
||||
Minus,
|
||||
} from "@element-plus/icons";
|
||||
|
||||
import "element-plus/dist/index.css";
|
||||
import APP from "./App.vue";
|
||||
|
||||
import Antd from 'ant-design-vue';
|
||||
import 'ant-design-vue/dist/antd.css';
|
||||
import APP from "./App.vue";
|
||||
|
||||
function createBaseApp(renderComponent = {}) {
|
||||
const app = createApp(renderComponent);
|
||||
app.use(ElementPlus);
|
||||
app.use(Antd);
|
||||
|
||||
app.component("question-filled", QuestionFilled);
|
||||
app.component("circle-plus", CirclePlus);
|
||||
@@ -38,13 +34,4 @@ self.createBaseApp = createBaseApp;
|
||||
self.globalApp = globalApp; // 内部需要使用Vuex
|
||||
|
||||
import("@/libs/store.js");
|
||||
|
||||
function loadVant() {
|
||||
const vantLoadPromise = (() => import("vant"))();
|
||||
(() => import("vant/lib/index.css"))();
|
||||
vantLoadPromise.then((vantModule) => {
|
||||
self.globalApp.use(vantModule);
|
||||
});
|
||||
}
|
||||
|
||||
loadVant();
|
||||
import("@/libs/UIComponentInit.js");
|
||||
Reference in New Issue
Block a user