[Vuejs]-Cannot import bootstrap in nuxt vue component

0👍

You should use bootstrap-vue, they fix a lot of issues and their tree-shacking works amazing.

your code will be

<template>
  <b-button v-b-modal.modal-1>Launch demo modal</b-button> 
  <b-modal id="modal-1" title="BootstrapVue" >
    <h1>Empty index page</h1>
  </b-modal>
</template>

<script>
  import { BModal, BButton } from 'bootstrap-vue'

  export default {
    name: "Modal Component",
    components: {
      'b-modal': BModal,
      'b-button': BButton
    }
  }
</script>

<style></style>

more info in the bootstrap-vue guide

Leave a comment