瀏覽代碼

部署后提示用户更新12

tyler 2 年之前
父節點
當前提交
80294c9052
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      src/App.vue

+ 6 - 4
src/App.vue

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