8000 compat with vue@2.0.0-alpha.7 · poorprogrammer/vuejs.org@881ebb6 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 881ebb6

Browse files
committed
compat with vue@2.0.0-alpha.7
1 parent c7470df commit 881ebb6

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"sinon-chai": "^2.8.0",
5757
"todomvc-app-css": "^2.0.3",
5858
"uglify-js": "^2.6.2",
59-
"vue": "^2.0.0-alpha.5",
59+
"vue": "^2.0.0-alpha.7",
6060
"vue-loader": "^9.0.3",
6161
"webpack": "^1.12.8",
6262
"webpack-dev-server": "^1.12.1"

src/override.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { getWatcher, getDep } from './util'
22

33
export default function (Vue) {
4-
var version = Number(Vue.version.split('.')[0])
4+
const version = Number(Vue.version.split('.')[0])
55

66
if (version >= 2) {
7-
Vue.mixin({
8-
init: vuexInit
9-
})
7+
const usesInit = Vue.config._lifecycleHooks.indexOf('init') > -1
8+
Vue.mixin(usesInit ? { init: vuexInit } : { beforeCreate: vuexInit })
109
} else {
1110
// override init and inject vuex init procedure
1211
// for 1.x backwards compatibility.

0 commit comments

Comments
 (0)
0