Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
npm
/
glsx-components
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 d1c4cc93
authored
Jun 20, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:添加gltablebutton中attrs的属性为函数的情况,传入该项和配置
1 parent
ebe9c475
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
src/packages/GlTableButton/src/index.vue
src/packages/GlTableButton/src/index.vue
View file @
d1c4cc9
...
@@ -22,8 +22,7 @@ export default {
...
@@ -22,8 +22,7 @@ export default {
}
}
},
},
data
()
{
data
()
{
return
{
return
{}
}
},
},
render
()
{
render
()
{
/**
/**
...
@@ -86,12 +85,18 @@ export default {
...
@@ -86,12 +85,18 @@ export default {
// //1.筛选过滤条件
// //1.筛选过滤条件
const
componentList
=
this
.
buttonList
const
componentList
=
this
.
buttonList
.
map
(
item
=>
{
.
map
(
item
=>
{
//处理
disabled情况(函数或者boolean)
//处理
attrs中属性为函数情况
item
=
deepcopy
(
item
)
item
=
deepcopy
(
item
)
if
(
objectType
(
item
.
attrs
.
disabled
)
===
'Function'
){
let
attrKeys
=
item
.
attrs
?
Object
.
keys
(
item
.
attrs
)
:
0
item
.
attrs
.
disabled
=
item
.
attrs
.
disabled
(
this
.
buttonItem
,
item
)
if
(
attrKeys
.
length
>
0
)
{
for
(
let
key
of
attrKeys
)
{
if
(
objectType
(
item
.
attrs
[
key
])
===
'Function'
)
{
item
.
attrs
[
key
]
=
item
.
attrs
[
key
](
this
.
buttonItem
,
item
)
}
}
}
}
//不传条件,默认显示
//不传条件,默认显示
if
(
!
item
.
condition
)
{
if
(
!
item
.
condition
)
{
return
item
return
item
...
...
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