Browse Source

部署后提示用户更新12

tyler 2 years ago
parent
commit
80294c9052
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/App.vue

+ 6 - 4
src/App.vue

@@ -10,24 +10,26 @@ import store from './store'
 export default {
 export default {
   name: 'App',
   name: 'App',
   created() {
   created() {
+    const self = this
+    console.log(store.state.app.language)
     document.body.addEventListener('plugin_web_update_notice', (e) => {
     document.body.addEventListener('plugin_web_update_notice', (e) => {
       const { version, options } = e.detail
       const { version, options } = e.detail
       // write some code, show your custom notification and etc.
       // write some code, show your custom notification and etc.
       console.log(version, options)
       console.log(version, options)
-      alert('System update!')
-      this.$confirm('检测到未保存的内容,是否在离开页面前保存修改?', '确认信息', {
+      // alert('System update!')
+      self.$confirm('检测到未保存的内容,是否在离开页面前保存修改?', '确认信息', {
         distinguishCancelAndClose: true,
         distinguishCancelAndClose: true,
         confirmButtonText: '保存',
         confirmButtonText: '保存',
         cancelButtonText: '放弃修改'
         cancelButtonText: '放弃修改'
       })
       })
         .then(() => {
         .then(() => {
-          this.$message({
+          self.$message({
             type: 'info',
             type: 'info',
             message: '保存修改'
             message: '保存修改'
           })
           })
         })
         })
         .catch(action => {
         .catch(action => {
-          this.$message({
+          self.$message({
             type: 'info',
             type: 'info',
             message: action === 'cancel'
             message: action === 'cancel'
               ? '放弃保存并离开页面'
               ? '放弃保存并离开页面'