| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <template>
- <div id="app">
- <router-view />
- </div>
- </template>
- <script>
- 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!')
- self.$confirm('检测到未保存的内容,是否在离开页面前保存修改?', '确认信息', {
- distinguishCancelAndClose: true,
- confirmButtonText: '保存',
- cancelButtonText: '放弃修改'
- })
- .then(() => {
- self.$message({
- type: 'info',
- message: '保存修改'
- })
- })
- .catch(action => {
- self.$message({
- type: 'info',
- message: action === 'cancel'
- ? '放弃保存并离开页面'
- : '停留在当前页面'
- })
- })
- })
- }
- }
- </script>
|