Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
184 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
var Vue = require('vue') | ||
|
||
Object.keys(Vue).forEach(function(key) { | ||
exports[key] = Vue[key] | ||
}) | ||
|
||
exports.set = function(target, key, val) { | ||
if (Array.isArray(target)) { | ||
target.length = Math.max(target.length, key) | ||
target.splice(key, 1, val) | ||
return val | ||
} | ||
Vue.set(target, key, val) | ||
return val | ||
} | ||
|
||
exports.del = function(target, key) { | ||
if (Array.isArray(target)) { | ||
target.splice(key, 1) | ||
return | ||
} | ||
Vue.delete(target, key) | ||
} | ||
|
||
exports.Vue = Vue | ||
exports.Vue2 = Vue | ||
exports.isVue2 = true | ||
exports.isVue3 = false | ||
exports.install = function(){} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Vue from 'vue' | ||
import type { PluginFunction, PluginObject } from 'vue' | ||
declare const isVue2: boolean | ||
declare const isVue3: boolean | ||
declare const Vue2: Vue | undefined | ||
declare const version: string | ||
declare const install: (vue?: Vue) => void | ||
/** | ||
* @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead. | ||
* Refer to https://github.com/vueuse/vue-demi/issues/41 | ||
*/ | ||
declare const V: Vue | ||
|
||
/** | ||
* DebuggerEvent is a Vue 3 development only feature. This type cannot exist in Vue 2. | ||
*/ | ||
export declare type DebuggerEvent = never | ||
|
||
// accept no generic because Vue 3 doesn't accept any | ||
// https://github.com/vuejs/vue-next/pull/2758/ | ||
export declare type Plugin = PluginObject<any> | PluginFunction<any> | ||
export type { VNode } from 'vue' | ||
export * from 'vue' | ||
export { | ||
V as Vue, | ||
Vue2, | ||
isVue2, | ||
isVue3, | ||
version, | ||
install, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import Vue from 'vue' | ||
|
||
var isVue2 = true | ||
var isVue3 = false | ||
var Vue2 = Vue | ||
|
||
function install() {} | ||
|
||
export function set(target, key, val) { | ||
if (Array.isArray(target)) { | ||
target.length = Math.max(target.length, key) | ||
target.splice(key, 1, val) | ||
return val | ||
} | ||
Vue.set(target, key, val) | ||
return val | ||
} | ||
|
||
export function del(target, key) { | ||
if (Array.isArray(target)) { | ||
target.splice(key, 1) | ||
return | ||
} | ||
Vue.delete(target, key) | ||
} | ||
|
||
export * from 'vue' | ||
export { | ||
Vue, | ||
Vue2, | ||
isVue2, | ||
isVue3, | ||
install, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters