Reference: https://blog.csdn.net/KingJin_CSDN_/article/details/77050569
main.js:
Router from Import './router' ; router.beforeEach ((to, from, Next) => { const toDepth = to.meta.index; const fromDepth = from.meta.index; IF (to.meta.title) { document.title = to.meta.title; } IF (toDepth == 'undefined' || toDepth == undefined) { the let Notice = '' ; IF (fromDepth == 0 ) { Notice = 'Supreme one page, coming off ' ; } the else { Notice =' into the page does not exist, will be shut down '; } Alert (Notice); // must have popups, or it may not be closed // this can turn off the phone Android system document.addEventListener ( 'WeixinJSBridgeReady', function () { WeixinJSBridge.call ( 'closeWindow' ); }, to false ); // this system can be turned off ios phone WeixinJSBridge.call ( 'closeWindow' ); // wx.closeWindow (); return ; } new new Vue ({ EL: '#app' , Router, Components: { the App } , Template:'<App/>' })