dev*_*evo 1 javascript vue.js vuejs2
我想在我的VueJS应用程序中使用这个第三方Toast组件,但是它给出了错误,
Unknown custom element: <toast-container> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
Run Code Online (Sandbox Code Playgroud)
main.ts
import VueOnToast from 'vue-on-toast';
..
Vue.use(BootstrapVue, Vuex, VueOnToast);
Run Code Online (Sandbox Code Playgroud)
App.vue
<toast-container></toast-container>
Run Code Online (Sandbox Code Playgroud)
见签名Vue.use:
Vue.use( plugin )
Run Code Online (Sandbox Code Playgroud)
Vue.use只需要一个参数.如果你传递的不止于此,则会被忽略.
你必须像这样使用它:
Vue.use(BootstrapVue);
Vue.use(Vuex);
Vue.use(VueOnToast);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
479 次 |
| 最近记录: |