判断实例 var vm = new Vue() console.log(vm._isVue) 判断 Vue 组件配置(new Vue(options) 的 options)只能 duck-typing,它只是一个普通对象,必须要有 template 属性或 render 方法。 function isVueOptions(options) { if (!options) { return false } return typeof options.template === 'string' || typeof options.render === 'function' }
判断实例
判断 Vue 组件配置(new Vue(options) 的 options)只能 duck-typing,它只是一个普通对象,必须要有
template
属性或render
方法。