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
5d51d487
Commit
5d51d487
authored
Jan 19, 2021
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(api-select): added numberToString prop #200
parent
b45f8c50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+12
-0
ApiSelect.vue
src/components/Form/src/components/ApiSelect.vue
+4
-2
No files found.
CHANGELOG.zh_CN.md
View file @
5d51d487
## Wip
### ✨ Features
-
`ApiSelect`
新增
`numberToString`
属性,用于将 value 为
`number`
的值全部转化为
`string`
### 🐛 Bug Fixes
-
修复 modal 高度计算错误
-
修复菜单折叠状态下点击标签页弹出菜单
-
修复 form 表单初始化值为 0 问题
## 2.0.0-rc.17 (2020-01-18)
### ✨ Refactor
...
...
src/components/Form/src/components/ApiSelect.vue
View file @
5d51d487
...
...
@@ -36,6 +36,7 @@
},
props
:
{
value
:
propTypes
.
string
,
numberToString
:
propTypes
.
bool
,
api
:
{
type
:
Function
as
PropType
<
(
arg
?:
Recordable
)
=>
Promise
<
OptionsItem
[]
>>
,
default
:
null
,
...
...
@@ -61,13 +62,14 @@
const
[
state
]
=
useRuleFormItem
(
props
);
const
getOptions
=
computed
(()
=>
{
const
{
labelField
,
valueField
}
=
props
;
const
{
labelField
,
valueField
,
numberToString
}
=
props
;
return
unref
(
options
).
reduce
((
prev
,
next
:
Recordable
)
=>
{
if
(
next
)
{
const
value
=
next
[
valueField
];
prev
.
push
({
label
:
next
[
labelField
],
value
:
n
ext
[
valueField
]
,
value
:
n
umberToString
?
`
${
value
}
`
:
value
,
});
}
return
prev
;
...
...
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