Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
577bf788
提交
577bf788
authored
11月 12, 2020
作者:
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: global registration of some components
上级
fc4666ef
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
69 行增加
和
4 行删除
+69
-4
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+2
-1
registerGlobComp.ts
src/components/registerGlobComp.ts
+57
-1
index.ts
src/setup/ant-design-vue/index.ts
+10
-2
没有找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
577bf788
...
@@ -8,8 +8,9 @@
...
@@ -8,8 +8,9 @@
### ✨ Features
### ✨ Features
-
表单项的
`componentsProps`
支持函数类型
-
表单项的
`componentsProps`
支持函数类型
-
菜单新增 tag 显示
-
菜单新增 tag 显示
,支持 4 中类型颜色及 dot 圆点显示
-
新增菜单及顶栏颜色选择配色
-
新增菜单及顶栏颜色选择配色
-
增加示例结果页
### ⚡ Performance Improvements
### ⚡ Performance Improvements
...
...
src/components/registerGlobComp.ts
浏览文件 @
577bf788
import
Icon
from
'./Icon/index'
;
import
Icon
from
'./Icon/index'
;
import
Button
from
'./Button/index.vue'
;
import
Button
from
'./Button/index.vue'
;
import
{
Button
as
AntButton
}
from
'ant-design-vue'
;
import
{
// Need
Button
as
AntButton
,
// Optional
Select
,
Checkbox
,
DatePicker
,
Radio
,
Switch
,
Card
,
List
,
Tabs
,
Descriptions
,
Tree
,
Table
,
Divider
,
Modal
,
Drawer
,
Dropdown
,
Tag
,
Tooltip
,
Badge
,
Popover
,
Upload
,
Transfer
,
Steps
,
}
from
'ant-design-vue'
;
import
{
getApp
}
from
'/@/useApp'
;
import
{
getApp
}
from
'/@/useApp'
;
const
compList
=
[
Icon
,
Button
,
AntButton
.
Group
];
const
compList
=
[
Icon
,
Button
,
AntButton
.
Group
];
...
@@ -12,5 +39,34 @@ export function registerGlobComp() {
...
@@ -12,5 +39,34 @@ export function registerGlobComp() {
compList
.
forEach
((
comp
:
any
)
=>
{
compList
.
forEach
((
comp
:
any
)
=>
{
getApp
().
component
(
comp
.
name
,
comp
);
getApp
().
component
(
comp
.
name
,
comp
);
});
});
registered
=
true
;
registered
=
true
;
// Optional
// Why register here: The main reason for registering here is not to increase the size of the first screen code
// If you need to customize global components, you can write here
// If you don’t need it, you can delete it
getApp
()
.
use
(
Select
)
.
use
(
Checkbox
)
.
use
(
DatePicker
)
.
use
(
Radio
)
.
use
(
Switch
)
.
use
(
Card
)
.
use
(
List
)
.
use
(
Descriptions
)
.
use
(
Tree
)
.
use
(
Table
)
.
use
(
Divider
)
.
use
(
Modal
)
.
use
(
Drawer
)
.
use
(
Dropdown
)
.
use
(
Tag
)
.
use
(
Tooltip
)
.
use
(
Badge
)
.
use
(
Popover
)
.
use
(
Upload
)
.
use
(
Transfer
)
.
use
(
Steps
)
.
use
(
Tabs
);
}
}
src/setup/ant-design-vue/index.ts
浏览文件 @
577bf788
...
@@ -2,12 +2,20 @@
...
@@ -2,12 +2,20 @@
import
type
{
App
}
from
'vue'
;
import
type
{
App
}
from
'vue'
;
import
{
Form
,
Input
,
Row
,
Col
}
from
'ant-design-vue'
;
import
{
// need
Form
,
Input
,
Row
,
Col
,
Spin
,
}
from
'ant-design-vue'
;
import
'ant-design-vue/dist/antd.css'
;
import
'ant-design-vue/dist/antd.css'
;
import
'./spin'
;
import
'./spin'
;
export
function
setupAntd
(
app
:
App
<
Element
>
)
{
export
function
setupAntd
(
app
:
App
<
Element
>
)
{
// need
// Here are the components required before registering and logging in
// Here are the components required before registering and logging in
app
.
use
(
Form
).
use
(
Input
).
use
(
Row
).
use
(
Col
);
app
.
use
(
Form
).
use
(
Input
).
use
(
Row
).
use
(
Col
)
.
use
(
Spin
)
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论