bootstrap-vue.js 和 laravel 未知自定义元素:<b-alert> 错误
bootstrap-vue.js with laravel Unknown custom element: <b-alert> error
我是 Vuejs 的新手,我收到错误未知的自定义元素 -
如何注册自定义元素 - b-alert。我认为这个元素来自 bootstrapVue.
<template>
<div>
<b-alert show>Default Alert</b-alert>
</div>
</template>
<script>
export default {
data () {
return {
dismissSecs: 10,
dismissCountDown: 0,
showDismissibleAlert: false
}
},
methods: {
countDownChanged (dismissCountDown) {
this.dismissCountDown = dismissCountDown
},
showAlert () {
this.dismissCountDown = this.dismissSecs
}
},
}
您必须按照 Component registration
中的方式注册组件
import { Alert } from 'bootstrap-vue/es/components';
components: { BAlert }
因为所有 html 标签都变成了驼峰式 BAlert
= '<b-alert>'
您也可以使用
components: { 'b-alert': BAlert }
我是 Vuejs 的新手,我收到错误未知的自定义元素 -
如何注册自定义元素 - b-alert。我认为这个元素来自 bootstrapVue.
<template>
<div>
<b-alert show>Default Alert</b-alert>
</div>
</template>
<script>
export default {
data () {
return {
dismissSecs: 10,
dismissCountDown: 0,
showDismissibleAlert: false
}
},
methods: {
countDownChanged (dismissCountDown) {
this.dismissCountDown = dismissCountDown
},
showAlert () {
this.dismissCountDown = this.dismissSecs
}
},
}
您必须按照 Component registration
中的方式注册组件import { Alert } from 'bootstrap-vue/es/components';
components: { BAlert }
因为所有 html 标签都变成了驼峰式 BAlert
= '<b-alert>'
您也可以使用
components: { 'b-alert': BAlert }