Skip to content

Commit fb85d3e

Browse files
committed
Checkbox Component: Set QCheckBox.setChecked using a checked component
1 parent 6d6fa4f commit fb85d3e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/CheckBox/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ViewProps, setProps as setViewProps } from "../View";
55
interface CheckBoxProps extends ViewProps {
66
children?: string;
77
text?: string;
8+
checked?: boolean;
89
}
910

1011
const setProps = (
@@ -15,6 +16,10 @@ const setProps = (
1516
const setter: CheckBoxProps = {
1617
set text(checkboxText: string) {
1718
widget.setText(checkboxText);
19+
},
20+
21+
set checked(isChecked: boolean) {
22+
widget.setChecked(isChecked);
1823
}
1924
};
2025
Object.assign(setter, newProps);

0 commit comments

Comments
 (0)