Add the default version of Vue.

This commit is contained in:
chengpeiquan 2021-01-04 18:30:31 +08:00
parent 27a45b8f56
commit 1126833f04

View File

@ -26,8 +26,8 @@ export default function install (Vue: Vue, { router, siteIdList, isDebug = false
*/ */
const pushBAIDU: any = new PushBAIDU(siteIdList, isDebug); const pushBAIDU: any = new PushBAIDU(siteIdList, isDebug);
// 获取Vue版本 // 获取Vue版本获取失败则默认为2
const VUE_VERSION: number = getVueVersion(Vue) || 0; const VUE_VERSION: number = getVueVersion(Vue) || 2;
// 2.x可以直接挂载到原型上 // 2.x可以直接挂载到原型上
if ( VUE_VERSION === 2 ) { if ( VUE_VERSION === 2 ) {