From 8d7dacdda742c1a23f5e9fd776a835e703b69272 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Wed, 9 Dec 2020 10:43:43 +0800 Subject: [PATCH] docs(Radio): use composition api --- src/radio/README.md | 38 +++++++++++++++++++++----------------- src/radio/README.zh-CN.md | 38 +++++++++++++++++++++----------------- src/radio/demo/index.vue | 20 ++++++++++++-------- 3 files changed, 54 insertions(+), 42 deletions(-) diff --git a/src/radio/README.md b/src/radio/README.md index 82b620541..e25553b92 100644 --- a/src/radio/README.md +++ b/src/radio/README.md @@ -18,18 +18,19 @@ app.use(RadioGroup); Use `v-model` to bind the name of checked radio. ```html - + Radio 1 Radio 2 ``` ```js +import { ref } from 'vue'; + export default { - data() { - return { - radio: '1', - }; + setup() { + const checked = ref('1'); + return { checked }; }, }; ``` @@ -37,7 +38,7 @@ export default { ### Horizontal ```html - + Radio 1 Radio 2 @@ -46,7 +47,7 @@ export default { ### Disabled ```html - + Radio 1 Radio 2 @@ -55,7 +56,7 @@ export default { ### Custom Shape ```html - + Radio 1 Radio 2 @@ -64,7 +65,7 @@ export default { ### Custom Color ```html - + Radio 1 Radio 2 @@ -73,7 +74,7 @@ export default { ### Custom Icon Size ```html - + Radio 1 Radio 2 @@ -84,7 +85,7 @@ export default { Use icon slot to custom icon ```html - + Radio 1