Skip to content

Commit d2630a4

Browse files
committed
Chore: simplify
1 parent 79266b5 commit d2630a4

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

src/index.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,16 @@ import Vue from "vue"
22
import App from "./app.vue"
33

44
const app = new Vue({
5-
computed: {
6-
updateReady: {
7-
get() {
8-
return this.$refs.app.showUpdateReadyToast
9-
},
10-
set(value) {
11-
this.$refs.app.showUpdateReadyToast = value
12-
},
5+
el: "#main",
6+
methods: {
7+
showUpdateReadyToast() {
8+
this.$refs.app.showUpdateReadyToast = true
139
},
1410
},
1511
render: (h) => h(App, { ref: "app" }),
1612
})
17-
app.$mount("#main")
1813

1914
// Check update.
20-
window.addEventListener("load", () => {
21-
applicationCache.addEventListener("updateready", () => {
22-
if (applicationCache.status === applicationCache.UPDATEREADY) {
23-
app.updateReady = true
24-
}
25-
})
15+
applicationCache.addEventListener("updateready", () => {
16+
app.showUpdateReadyToast()
2617
})

0 commit comments

Comments
 (0)