docs(Notify): use composition api

This commit is contained in:
chenjiahan
2020-12-13 16:58:10 +08:00
parent 65e14cd84a
commit 57c860afb8
3 changed files with 92 additions and 73 deletions
+14 -10
View File
@@ -65,19 +65,23 @@ export default {
```
```js
import { ref } from 'vue';
export default {
data() {
return {
show: false,
};
},
methods: {
showNotify() {
this.show = true;
setup() {
const show = ref(false);
const showNotify = () => {
show.value = true;
setTimeout(() => {
this.show = false;
show.value = false;
}, 2000);
},
};
return {
show,
showNotify,
};
},
};
```