Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6f874a8a
authored
Apr 21, 2026
by
Jaxon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat(libs): 新增 setAllOptions 函数为下拉选项添加“全部”项
1 parent
fccefd06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
src/libs/select.js
src/libs/select.js
0 → 100644
View file @
6f874a8
/**
* 传入 存放 options的数组, 把所有 第一项 不是 "" 的, 添加第一项, 然后设置 label为 全部
* @param {*} list 存放 options的数组
*/
export
function
setAllOptions
(
list
)
{
list
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
type
===
"select"
)
{
if
(
item
.
optionList
[
0
][
item
.
optionLabel
]
!==
"全部"
)
{
item
.
optionList
.
unshift
({
[
item
.
optionId
]:
""
,
[
item
.
optionLabel
]:
"全部"
,
});
}
}
});
return
list
;
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment