mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
docs(Tag): use composition api
This commit is contained in:
parent
afd3474da3
commit
9fbda243cf
@ -48,16 +48,19 @@ app.use(Tag);
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
setup() {
|
||||||
return {
|
const show = ref(true);
|
||||||
show: true,
|
const close = () => {
|
||||||
|
show.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
show,
|
||||||
|
close,
|
||||||
};
|
};
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
close() {
|
|
||||||
this.show = false;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
@ -58,16 +58,19 @@ app.use(Tag);
|
|||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
setup() {
|
||||||
return {
|
const show = ref(true);
|
||||||
show: true,
|
const close = () => {
|
||||||
|
show.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
show,
|
||||||
|
close,
|
||||||
};
|
};
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
close() {
|
|
||||||
this.show = false;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
@ -63,6 +63,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
i18n: {
|
i18n: {
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
@ -98,16 +100,16 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
setup() {
|
||||||
return {
|
const show = ref(true);
|
||||||
show: true,
|
const close = () => {
|
||||||
|
show.value = false;
|
||||||
};
|
};
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
return {
|
||||||
close() {
|
show,
|
||||||
this.show = false;
|
close,
|
||||||
},
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user