Skip to content

Commit c4cf57d

Browse files
author
shangbin
committed
Merge branch 'antd-vue3' into vue3-vant
2 parents 91d4346 + 84b09f0 commit c4cf57d

File tree

12 files changed

+339
-20
lines changed

12 files changed

+339
-20
lines changed

package-lock.json

Lines changed: 152 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"@element-plus/icons": "0.0.11",
2626
"@vitejs/plugin-vue": "^1.10.0",
2727
"@vue/compiler-sfc": "^3.2.22",
28+
"ant-design-vue": "^3.0.0-alpha.14",
2829
"axios": "^0.21.4",
2930
"codemirror-editor-vue3": "^0.2.4",
3031
"copy-to-clipboard": "^3.3.1",

src/assets/logo/antd-n.svg

Lines changed: 29 additions & 0 deletions
Loading

src/components/RawComponents.vue

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
<div style="overflow:scroll;padding:0 10px;">
5454
<keep-alive>
55-
<component :is="currentSelectBrand.componentName" @mounted='onMouted'></component>
55+
<component :is="currentSelectBrand.componentName" @mounted='onMouted(currentIndex)'></component>
5656
</keep-alive>
5757
</div>
5858

@@ -99,6 +99,14 @@ export default {
9999
}, {
100100
icon: ('https://static.imonkey.xueersi.com/download/vcc-resource/logo/quasar-n.png'),
101101
enable: false
102+
}, {
103+
icon: ('https://static.imonkey.xueersi.com/download/vcc-resource/logo/antd-n.svg'), // 组件库导航图标
104+
clickCallback: this.onSelectElement, // 图标点击回调
105+
className: "demonstration-antd", // 组件索引标题class。用来搜集标题供快速导航
106+
selectIndex: 0, // 默认选中基础组件索引
107+
componentName: 'antd', // 动态组件名称
108+
enable: true, // 是否可用
109+
titleArray: [], // 快速索引标题,默认为空,VCC会自动按照className搜集快速索引标题。
102110
},],
103111
104112
currentIndex: 0
@@ -145,9 +153,8 @@ export default {
145153
}
146154
},
147155
148-
onMouted() {
149-
// 这里目前只支持ele,所以只写了1
150-
this.initOnly(this.iconArray[1]);
156+
onMouted(index) {
157+
this.initOnly(this.iconArray[index]);
151158
},
152159
153160
selectSubnav(obj, index) {
@@ -159,6 +166,9 @@ export default {
159166
this.initOnly(this.iconArray[0]);
160167
},
161168
169+
/**
170+
* 初始化组件导航栏,只有2个及以上的组件类才会出现
171+
*/
162172
initOnly(mountedObject) {
163173
const titles = document.getElementsByClassName(mountedObject.className);
164174
@@ -210,6 +220,7 @@ export default {
210220
// iview,
211221
// quasar,
212222
ele: defineAsyncComponent(() => import("../rawComponents/element/index.vue")),
223+
antd: defineAsyncComponent(() => import("../rawComponents/antd"))
213224
},
214225
215226
};

src/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ import {
1212
import "element-plus/dist/index.css";
1313
import APP from "./App.vue";
1414

15+
import Antd from 'ant-design-vue';
16+
import 'ant-design-vue/dist/antd.css';
17+
1518
function createBaseApp(renderComponent = {}) {
1619
const app = createApp(renderComponent);
1720
app.use(ElementPlus);
21+
app.use(Antd);
1822

1923
app.component("question-filled", QuestionFilled);
2024
app.component("circle-plus", CirclePlus);

0 commit comments

Comments
 (0)