Skip to content

Commit

Permalink
fix(tree): 解决合并冲突
Browse files Browse the repository at this point in the history
  • Loading branch information
TabSpace committed Oct 20, 2023
2 parents 05cc51f + 24a4bd5 commit 09c65c9
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 81 deletions.
16 changes: 8 additions & 8 deletions src/checkbox/__tests__/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ exports[`Checkbox CheckboxGroup > :props > :checked 1`] = `
</span>
</label>
<label
class="t-checkbox"
tabindex="0"
class="t-checkbox t-is-disabled"
>
<input
class="t-checkbox__former"
disabled="disabled"
tabindex="-1"
type="checkbox"
value="sz"
Expand Down Expand Up @@ -177,11 +177,11 @@ exports[`Checkbox CheckboxGroup > :props > :defaultChecked 1`] = `
</span>
</label>
<label
class="t-checkbox"
tabindex="0"
class="t-checkbox t-is-disabled"
>
<input
class="t-checkbox__former"
disabled="disabled"
tabindex="-1"
type="checkbox"
value="sz"
Expand Down Expand Up @@ -356,11 +356,11 @@ exports[`Checkbox CheckboxGroup > :props > :name 1`] = `
</span>
</label>
<label
class="t-checkbox"
tabindex="0"
class="t-checkbox t-is-disabled"
>
<input
class="t-checkbox__former"
disabled="disabled"
tabindex="-1"
type="checkbox"
value="sz"
Expand All @@ -384,11 +384,11 @@ exports[`Checkbox CheckboxGroup > :props > :options 1`] = `
role="group"
>
<label
class="t-checkbox"
tabindex="0"
class="t-checkbox t-is-disabled"
>
<input
class="t-checkbox__former"
disabled="disabled"
tabindex="-1"
type="checkbox"
value="gz"
Expand Down
12 changes: 8 additions & 4 deletions src/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,16 @@ export default defineComponent({
}
};

watch([checkboxStore], () => {
if (!checkboxStore.value?.parentExist) {
tDisabled.value = props.disabled;
}
});

watch(
[disabled, checkboxStore],
[disabled],
([val]) => {
if (!checkboxStore.value?.parentExist) {
tDisabled.value = val;
}
tDisabled.value = val;
},
{ immediate: true },
);
Expand Down
Loading

0 comments on commit 09c65c9

Please sign in to comment.