[Vuejs]-How i can register component globally and define default behavior?

0👍

if you’re using Webpack (or Vue CLI 3+, which uses Webpack
internally), you can use require.context to globally register only
these very common base components

https://v2.vuejs.org/v2/guide/components-registration.html#Automatic-Global-Registration-of-Base-Components

define your default behavior inside your SmartSelect component.

if your meaning was to define a default behavior to all vue components, than you should read more about vue inheritance, which is a way to declare a base component with defaut behavior, and make other components to inherit and override that behavior. here’s a good place to start

Leave a comment