Using Vue.set() and Vue.use() in .vue files

Your components have Vue.set available as this.$set. For reference: instance methods & properties.

Vue.use is a global method and can be called wherever. It is basically never called inside a component(and might actually throw if you try? Never tried it). Call it wherever you're doing the rest of your initialization.


You have to use import wherever you need Vue or vee-validate, you can do it like following inside the script tag:

<script>
import Vue from 'vue'
import VeeValidate from 'vee-validate'

Vue.use(VeeValidate)
...
...
</script>

If you just want to do Vue.set, you can instead do this.$set which is the alias of the global Vue.set.

Tags:

Vue.Js

Vuejs2