...

/

Wrapper Components

Wrapper Components

Learn the reason for using wrapper components and how we use them in a Vue application.

Vue applications usually use at least a few third-party libraries and components.

The vue-multiselect library

Let’s take the vue-multiselect package as an example. Applications with many forms could use a select component in quite a few places.

Press + to interact
<template>
<vue-multiselect :options="options" v-model="value" searchable label="name" />
</template>

What happens if we need to move away from vue-multiselect to a different library? There could be several reasons why we w’d to switch libraries, such as lack of maintenance, licensing changes, lack of specific features, or because we want to switch to the next version of Vue, but the library we’re using won’t provide a compatible version any time soon. If we have used the <vue-multiselect/> component directly, each file using it needs to be changed. That’s ...