Use the return key to close the vue plugin of the modal
npm install vue-native-back --save
## or
yarn add vue-native-back
import Vue from "vue";
import NativeBack from "vue-native-back";
Vue.use(NativeBack);
import { createApp } from "vue";
import NativeBack from "vue-native-back";
import App from "./App.vue";
createApp(App).use(NativeBack);
<native-back
:state="[visibleAlert, visibleConfirm]"
:closeMethods="[onCloseAlert, onCloseConfirm]"
/>
data() {
return {
visibleAlert: false,
visibleConfirm: false
};
},
methods: {
onCloseAlert() {
this.visibleAlert = false;
},
onCloseConfirm() {
this.visibleConfirm = false;
}
}
See src/
Property | Description | Type | Default |
---|---|---|---|
enable | Whether to start the plug-in | boolean | true |
Property | Description | Type | Default |
---|---|---|---|
state | The display state of the modal box | Array | [] |
closeMethods | Close method of modal box | Array | [] |
# dev
npm run serve
# build
npm run build:lib
Author: luoxuhai
Demo: https://codesandbox.io/s/vuejsyanxi-cgk4l
Source Code: https://github.com/luoxuhai/vue-native-back
#vue #vuejs #javascript