Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(checkbox-group): add borderless property #2124

Merged
merged 2 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/checkbox-group/checkbox-group.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
max-content-row="{{item.maxContentRow || 5}}"
max-label-row="{{item.maxLabelRow || 3}}"
name="{{item.name || ''}}"
borderless="{{borderless}}"
readonly="{{item.readonly || false}}"
bind:change="handleInnerChildChange"
placement="{{item.placement || 'left'}}"
Expand Down
5 changes: 5 additions & 0 deletions src/checkbox-group/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ const props: TdCheckboxGroupProps = {
type: String,
value: '',
},
/** 是否开启无边框模式 */
borderless: {
type: Boolean,
value: false,
},
/** 是否禁用组件 */
disabled: {
type: Boolean,
Expand Down
5 changes: 5 additions & 0 deletions src/checkbox-group/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export interface TdCheckboxGroupProps {
type: StringConstructor;
value?: string;
};
/** 是否开启无边框模式 */
borderless: {
type: BooleanConstructor;
value?: boolean;
};
/**
* 是否禁用组件
* @default false
Expand Down
1 change: 1 addition & 0 deletions src/checkbox/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ change | `(checked: boolean)` | \-

name | type | default | description | required
-- | -- | -- | -- | --
borderless | Boolean | false | \- | N
disabled | Boolean | false | \- | N
max | Number | undefined | \- | N
name | String | - | \- | N
Expand Down
1 change: 1 addition & 0 deletions src/checkbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ change | `(checked: boolean)` | 值变化时触发

名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
borderless | Boolean | false | 是否开启无边框模式 | N
disabled | Boolean | false | 是否禁用组件 | N
max | Number | undefined | 支持最多选中的数量 | N
name | String | - | 统一设置内部复选框 HTML 属性 | N
Expand Down
1 change: 1 addition & 0 deletions src/checkbox/__test__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ exports[`Checkbox Checkbox all demo works fine 1`] = `
exports[`Checkbox Checkbox base demo works fine 1`] = `
<base>
<t-checkbox-group
borderless="{{true}}"
options="{{
Array [
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ exports[`Checkbox Checkbox all demo works fine 1`] = `
exports[`Checkbox Checkbox base demo works fine 1`] = `
<base>
<t-checkbox-group
borderless="{{true}}"
options="{{
Array [
Object {
Expand Down
2 changes: 1 addition & 1 deletion src/checkbox/_example/base/index.wxml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<t-checkbox-group value="{{current}}" bind:change="handleGroupChange" options="{{options}}" />
<t-checkbox-group value="{{current}}" borderless bind:change="handleGroupChange" options="{{options}}" />