docs(Field): use composition api

This commit is contained in:
chenjiahan
2020-12-09 14:06:36 +08:00
parent 2f40e23be9
commit b423259f45
11 changed files with 117 additions and 66 deletions
+10 -8
View File
@@ -17,6 +17,8 @@
</template>
<script>
import { reactive, toRefs } from 'vue';
export default {
i18n: {
'zh-CN': {
@@ -33,17 +35,17 @@ export default {
},
},
data() {
return {
setup() {
const state = reactive({
value1: '',
value2: '',
};
},
});
const formatter = (value) => value.replace(/\d/g, '');
methods: {
formatter(value) {
return value.replace(/\d/g, '');
},
return {
...toRefs(state),
formatter,
};
},
};
</script>