Skip to content

Commit 66747ed

Browse files
authored
Option to complete disable slide-up-down
1 parent 7966d94 commit 66747ed

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/slide-up-down.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ export default {
1515
type: Boolean,
1616
default: true,
1717
},
18+
disabled: {
19+
type: Boolean,
20+
default: false
21+
},
1822
},
1923

2024
data: () => ({
@@ -33,7 +37,7 @@ export default {
3337
return h(
3438
this.tag,
3539
{
36-
style: this.style,
40+
style: this.renderStyle,
3741
attrs: this.attrs,
3842
ref: 'container',
3943
on: { transitionend: this.onTransitionEnd },
@@ -66,8 +70,11 @@ export default {
6670
attrs.hidden = this.hidden
6771
}
6872

69-
return attrs
73+
return !this.disabled ? attrs : {}
7074
},
75+
renderStyle() {
76+
return !this.disabled ? this.style : {}
77+
}
7178
},
7279

7380
methods: {

0 commit comments

Comments
 (0)