Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
577bf788
Commit
577bf788
authored
Nov 12, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: global registration of some components
parent
fc4666ef
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
4 deletions
+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
No files found.
CHANGELOG.zh_CN.md
View file @
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
View file @
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
View file @
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
)
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment