Skip to content

Commit 0f2468a

Browse files
author
Guillaume Chau
authored
Move code to initBodyClass (#554)
1 parent 2df8065 commit 0f2468a

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/devtools/env.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Object.defineProperties(Vue.prototype, {
2121
'$keys': { get: () => keys }
2222
})
2323

24-
if (isWindows) document.body.classList.add('platform-windows')
25-
if (isMac) document.body.classList.add('platform-mac')
26-
if (isLinux) document.body.classList.add('platform-linux')
24+
export function initBodyClass () {
25+
if (isWindows) document.body.classList.add('platform-windows')
26+
if (isMac) document.body.classList.add('platform-mac')
27+
if (isLinux) document.body.classList.add('platform-linux')
28+
}

src/devtools/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import App from './App.vue'
33
import store from './store'
44
import './plugins'
55
import { parse } from '../util'
6-
import { isChrome } from './env'
6+
import { isChrome, initBodyClass } from './env'
77

88
// UI
99

@@ -134,10 +134,13 @@ function initApp (shell) {
134134

135135
app = new Vue({
136136
extends: App,
137+
137138
store,
139+
138140
data: {
139141
isDark
140142
},
143+
141144
watch: {
142145
isDark: {
143146
handler (value) {
@@ -149,6 +152,10 @@ function initApp (shell) {
149152
},
150153
immediate: true
151154
}
155+
},
156+
157+
mounted () {
158+
initBodyClass()
152159
}
153160
}).$mount('#app')
154161

0 commit comments

Comments
 (0)