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 e1271827
authored
Apr 18, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add:GlTableButton添加disabled状态
1 parent
d86bc743
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
src/App.vue
src/packages/GlTableButton/src/index.vue
src/App.vue
View file @
e127182
...
@@ -496,10 +496,11 @@ export default {
...
@@ -496,10 +496,11 @@ export default {
return
'打开'
return
'打开'
},
},
condition
:
row
=>
{
condition
:
row
=>
{
return
fals
e
return
tru
e
},
},
attrs
:
{
attrs
:
{
type
:
'text'
type
:
'text'
,
disabled
:
false
},
},
listeners
:
{
listeners
:
{
click
:
this
.
conditionFn
click
:
this
.
conditionFn
...
...
src/packages/GlTableButton/src/index.vue
View file @
e127182
...
@@ -121,10 +121,13 @@ export default {
...
@@ -121,10 +121,13 @@ export default {
// status = item.condition(this.buttonItem)
// status = item.condition(this.buttonItem)
// }
// }
// console.log(objectType(status) )
// console.log(objectType(status) )
status
=
item
.
condition
(
this
.
buttonItem
,
item
)
status
=
item
.
condition
(
this
.
buttonItem
,
item
)
}
else
if
(
item
.
type
==
'GLButton'
)
{
}
else
if
(
item
.
type
==
'GLButton'
)
{
status
=
item
.
condition
(
this
.
buttonItem
,
item
)
&&
hasPermission
.
call
(
this
,
item
.
attrs
.
fn
)
status
=
item
.
condition
(
this
.
buttonItem
,
item
)
&&
hasPermission
.
call
(
this
,
item
.
attrs
.
fn
)
}
}
//处理disabled情况(函数或者boolean)
item
.
attrs
.
disabled
=
item
.
attrs
.
disabled
?
(
objectType
(
item
.
attrs
.
disabled
)
===
'Function'
?
item
.
attrs
.
disabled
(
this
.
buttonItem
,
item
)
:
item
.
attrs
.
disabled
)
:
false
if
(
status
)
{
if
(
status
)
{
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