1
votes

I wanted to use this third party toast component in my VueJS app but it is giving error,

Unknown custom element: <toast-container> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

main.ts

import VueOnToast from 'vue-on-toast';
..
Vue.use(BootstrapVue, Vuex, VueOnToast);

App.vue

<toast-container></toast-container>
1

1 Answers

6
votes

See the signature of Vue.use:

Vue.use( plugin )

Vue.use only expects a single argument. If you pass more than that, they are ignored.

You have to use it like this:

Vue.use(BootstrapVue);
Vue.use(Vuex);
Vue.use(VueOnToast);