How to check if an object is a Vue component?

Like Saurabh wrote, instanceof is probably the best way to be sure. However, in case you don't want to import Vue just for this purpose, you could use this._isVue.


You can use instanceof, as following code:

var isVueComp = vuecomp instanceof Vue

If it isVueComp is true, it is a Vue.js componeny otherwise not.

You can also use vuecomp.prototype.constructor, which will return reference to the Object constructor function that created the instance object.

Check this fiddle.