|
@@ -8,6 +8,7 @@ import { initAssetRegisters } from './assets'
|
|
|
import { set, del } from '../observer/index'
|
|
import { set, del } from '../observer/index'
|
|
|
import { ASSET_TYPES } from 'shared/constants'
|
|
import { ASSET_TYPES } from 'shared/constants'
|
|
|
import builtInComponents from '../components/index'
|
|
import builtInComponents from '../components/index'
|
|
|
|
|
+import { observe } from 'core/observer/index'
|
|
|
|
|
|
|
|
import {
|
|
import {
|
|
|
warn,
|
|
warn,
|
|
@@ -44,6 +45,12 @@ export function initGlobalAPI (Vue: GlobalAPI) {
|
|
|
Vue.delete = del
|
|
Vue.delete = del
|
|
|
Vue.nextTick = nextTick
|
|
Vue.nextTick = nextTick
|
|
|
|
|
|
|
|
|
|
+ // 2.6 explicit observable API
|
|
|
|
|
+ Vue.observable = (obj: any): any => {
|
|
|
|
|
+ observe(obj)
|
|
|
|
|
+ return obj
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
Vue.options = Object.create(null)
|
|
Vue.options = Object.create(null)
|
|
|
ASSET_TYPES.forEach(type => {
|
|
ASSET_TYPES.forEach(type => {
|
|
|
Vue.options[type + 's'] = Object.create(null)
|
|
Vue.options[type + 's'] = Object.create(null)
|