javascript - bootstrap-vue.js with laravel Unknown custom element: <b-alert> error - Stack Overflow

Im new to Vuejs and I get the error unknown custom element - how do i register a custom element - b-ale

Im new to Vuejs and I get the error unknown custom element -

how do i register a custom element - b-alert. I think this element is from 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
             }

     },

}

Im new to Vuejs and I get the error unknown custom element -

how do i register a custom element - b-alert. I think this element is from 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
             }

     },

}

Share Improve this question asked Jul 18, 2018 at 20:05 Naishu BabuNaishu Babu 612 silver badges14 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

You will have to register the ponent as in Component registration

import { Alert } from 'bootstrap-vue/es/ponents';

ponents: { BAlert }

Since all html tags are turned into dashed by camelcase BAlert = '<b-alert>'

Alertenativly you can also use

ponents: { 'b-alert': BAlert }

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745118245a4612259.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信