Skip to content

Commit 10e307e

Browse files
authored
feat: add warn to vue 2.7 (#189)
1 parent b85b536 commit 10e307e

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

lib/v2.7/index.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ exports.Vue2 = Vue
55
exports.isVue2 = true
66
exports.isVue3 = false
77
exports.install = function () {}
8+
exports.warn = Vue.util.warn
89

910
// createApp polyfill
1011
exports.createApp = function (rootComponent, rootProps) {

lib/v2.7/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import Vue from 'vue'
2-
import type { PluginFunction, PluginObject, VueConstructor, Directive, InjectionKey } from 'vue'
2+
import type { PluginFunction, PluginObject, VueConstructor, Directive, InjectionKey, Component } from 'vue'
33

44
declare const isVue2: boolean
55
declare const isVue3: boolean
66
declare const Vue2: typeof Vue | undefined
77
declare const version: string
88
declare const install: (vue?: typeof Vue) => void
9+
export declare function warn(msg: string, vm?: Component | null): void
910
/**
1011
* @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead.
1112
* Refer to https://github.com/vueuse/vue-demi/issues/41

lib/v2.7/index.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Vue from 'vue'
33
var isVue2 = true
44
var isVue3 = false
55
var Vue2 = Vue
6+
var warn = Vue.util.warn
67

78
function install() {}
89

@@ -46,5 +47,5 @@ export function createApp(rootComponent, rootProps) {
4647
return app
4748
}
4849

49-
export { Vue, Vue2, isVue2, isVue3, install }
50+
export { Vue, Vue2, isVue2, isVue3, install, warn }
5051
export * from 'vue'

0 commit comments

Comments
 (0)