Skip to content

Commit

Permalink
feat: add warn to vue 2.7 (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
posva authored Aug 23, 2022
1 parent b85b536 commit 10e307e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/v2.7/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports.Vue2 = Vue
exports.isVue2 = true
exports.isVue3 = false
exports.install = function () {}
exports.warn = Vue.util.warn

// createApp polyfill
exports.createApp = function (rootComponent, rootProps) {
Expand Down
3 changes: 2 additions & 1 deletion lib/v2.7/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import Vue from 'vue'
import type { PluginFunction, PluginObject, VueConstructor, Directive, InjectionKey } from 'vue'
import type { PluginFunction, PluginObject, VueConstructor, Directive, InjectionKey, Component } from 'vue'

declare const isVue2: boolean
declare const isVue3: boolean
declare const Vue2: typeof Vue | undefined
declare const version: string
declare const install: (vue?: typeof Vue) => void
export declare function warn(msg: string, vm?: Component | null): 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
Expand Down
3 changes: 2 additions & 1 deletion lib/v2.7/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Vue from 'vue'
var isVue2 = true
var isVue3 = false
var Vue2 = Vue
var warn = Vue.util.warn

function install() {}

Expand Down Expand Up @@ -46,5 +47,5 @@ export function createApp(rootComponent, rootProps) {
return app
}

export { Vue, Vue2, isVue2, isVue3, install }
export { Vue, Vue2, isVue2, isVue3, install, warn }
export * from 'vue'

0 comments on commit 10e307e

Please sign in to comment.