docs(Tag): use composition api

This commit is contained in:
chenjiahan 2020-12-09 14:41:52 +08:00
parent afd3474da3
commit 9fbda243cf
3 changed files with 32 additions and 24 deletions

View File

@ -48,16 +48,19 @@ app.use(Tag);
```
```js
import { ref } from 'vue';
export default {
data() {
return {
show: true,
setup() {
const show = ref(true);
const close = () => {
show.value = false;
};
return {
show,
close,
};
},
methods: {
close() {
this.show = false;
},
},
};
```

View File

@ -58,16 +58,19 @@ app.use(Tag);
```
```js
import { ref } from 'vue';
export default {
data() {
return {
show: true,
setup() {
const show = ref(true);
const close = () => {
show.value = false;
};
return {
show,
close,
};
},
methods: {
close() {
this.show = false;
},
},
};
```

View File

@ -63,6 +63,8 @@
</template>
<script>
import { ref } from 'vue';
export default {
i18n: {
'zh-CN': {
@ -98,16 +100,16 @@ export default {
},
},
data() {
return {
show: true,
setup() {
const show = ref(true);
const close = () => {
show.value = false;
};
},
methods: {
close() {
this.show = false;
},
return {
show,
close,
};
},
};
</script>