Skip to content

Commit

Permalink
fix(collapse-panel): expandIcon does not take effect (#3093)
Browse files Browse the repository at this point in the history
* fix(collapse-panel): expandIcon does not take effect

* fix(Collapse): 支持动态设置disabled

---------

Co-authored-by: jarmywang <awangjianjun9@gmail.com>
  • Loading branch information
blankqwq and jarmywang authored Sep 1, 2024
1 parent 32d4b17 commit cc2c61b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/collapse-panel/collapse-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class CollapsePanel extends SuperComponent {
const { value, expandIcon, disabled } = target.properties;

this.setData({
ultimateExpandIcon: expandIcon || this.properties.expandIcon,
ultimateExpandIcon: this.properties.expandIcon == null ? expandIcon : this.properties.expandIcon,
ultimateDisabled: this.properties.disabled == null ? disabled : this.properties.disabled,
});

Expand All @@ -43,6 +43,12 @@ export default class CollapsePanel extends SuperComponent {
ultimateDisabled: false,
};

observers = {
disabled(v) {
this.setData({ ultimateDisabled: !!v });
},
};

methods = {
updateExpanded(activeValues = []) {
if (!this.$parent || this.data.ultimateDisabled) {
Expand Down

0 comments on commit cc2c61b

Please sign in to comment.