-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(comp:radio): use dataSource instead of options
BREAKING CHANGE: `options` was deprecated, please use `dataSource` instead
- Loading branch information
Showing
14 changed files
with
89 additions
and
118 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
packages/components/radio/__tests__/__snapshots__/radioGroup.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`RadioGroup render work 1`] = `"<label class=\\"ix-radio\\" role=\\"radio\\" aria-checked=\\"false\\"><span class=\\"ix-radio-input\\"><input type=\\"radio\\" class=\\"ix-radio-input-inner\\" aria-hidden=\\"true\\" options=\\"[object Object],[object Object],[object Object],[object Object]\\"><span class=\\"ix-radio-input-box\\"></span></span><span class=\\"ix-radio-label\\">Test</span></label>"`; | ||
exports[`RadioGroup render work 1`] = `"<div class=\\"ix-radio-group\\"><label class=\\"ix-radio\\" role=\\"radio\\" aria-checked=\\"false\\" aria-disabled=\\"false\\"><span class=\\"ix-radio-input\\"><input type=\\"radio\\" class=\\"ix-radio-input-inner\\" aria-hidden=\\"true\\" value=\\"a\\"><span class=\\"ix-radio-input-box\\"></span></span><span class=\\"ix-radio-label\\">Beijing</span></label><label class=\\"ix-radio\\" role=\\"radio\\" aria-checked=\\"false\\" aria-disabled=\\"false\\"><span class=\\"ix-radio-input\\"><input type=\\"radio\\" class=\\"ix-radio-input-inner\\" aria-hidden=\\"true\\" value=\\"b\\"><span class=\\"ix-radio-input-box\\"></span></span><span class=\\"ix-radio-label\\">Shanghai</span></label><label class=\\"ix-radio\\" role=\\"radio\\" aria-checked=\\"false\\" aria-disabled=\\"false\\"><span class=\\"ix-radio-input\\"><input type=\\"radio\\" class=\\"ix-radio-input-inner\\" aria-hidden=\\"true\\" value=\\"c\\"><span class=\\"ix-radio-input-box\\"></span></span><span class=\\"ix-radio-label\\">Guangzhou</span></label><label class=\\"ix-radio\\" role=\\"radio\\" aria-checked=\\"false\\" aria-disabled=\\"false\\"><span class=\\"ix-radio-input\\"><input type=\\"radio\\" class=\\"ix-radio-input-inner\\" aria-hidden=\\"true\\" value=\\"d\\"><span class=\\"ix-radio-input-box\\"></span></span><span class=\\"ix-radio-label\\">Shenzhen</span></label></div>"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
<template> | ||
<IxSpace vertical> | ||
<IxRadioGroup v-model:value="value" buttoned> | ||
<IxRadio value="beijing">Beijing</IxRadio> | ||
<IxRadio value="shanghai">Shanghai</IxRadio> | ||
<IxRadio value="guangzhou">Guangzhou</IxRadio> | ||
<IxRadio value="shenzhen">Shenzhen</IxRadio> | ||
</IxRadioGroup> | ||
<IxRadioGroup v-model:value="value" buttoned mode="primary"> | ||
<IxRadio value="beijing">Beijing</IxRadio> | ||
<IxRadio value="shanghai">Shanghai</IxRadio> | ||
<IxRadio value="guangzhou">Guangzhou</IxRadio> | ||
<IxRadio value="shenzhen">Shenzhen</IxRadio> | ||
</IxRadioGroup> | ||
<IxRadioGroup v-model:value="value" buttoned disabled> | ||
<IxRadio value="beijing">Beijing</IxRadio> | ||
<IxRadio value="shanghai">Shanghai</IxRadio> | ||
<IxRadio value="guangzhou">Guangzhou</IxRadio> | ||
<IxRadio value="shenzhen">Shenzhen</IxRadio> | ||
</IxRadioGroup> | ||
<IxRadioGroup v-model:value="value" buttoned :dataSource="dataSource"> </IxRadioGroup> | ||
<IxRadioGroup v-model:value="value" buttoned :dataSource="dataSource" mode="primary"> </IxRadioGroup> | ||
<IxRadioGroup v-model:value="value" buttoned :dataSource="dataSource" disabled> </IxRadioGroup> | ||
</IxSpace> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
const value = ref('beijing') | ||
const dataSource = [ | ||
{ label: 'Beijing', value: 'beijing' }, | ||
{ label: 'Shanghai', value: 'shanghai' }, | ||
{ label: 'Guangzhou', value: 'guangzhou' }, | ||
{ label: 'Shenzhen', value: 'shenzhen' }, | ||
] | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
<template> | ||
<IxRadioGroup v-model:value="value" @Change="onChange"> | ||
<IxRadio value="a">A</IxRadio> | ||
<IxRadio value="b">B</IxRadio> | ||
<IxRadio value="c">C</IxRadio> | ||
<IxRadio value="d">D</IxRadio> | ||
</IxRadioGroup> | ||
<IxRadioGroup v-model:value="value" :dataSource="dataSource" @Change="onChange"> </IxRadioGroup> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
const value = ref('a') | ||
import { RadioData } from '@idux/components/radio' | ||
const value = ref('beijing') | ||
const dataSource: RadioData[] = [ | ||
{ label: 'Beijing', value: 'beijing' }, | ||
{ label: 'Shanghai', value: 'shanghai' }, | ||
{ label: 'Guangzhou', value: 'guangzhou' }, | ||
{ label: 'Shenzhen', value: 'shenzhen' }, | ||
] | ||
const onChange = console.log | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.