Topic: mdb is not defined

AntoSky_ priority asked 8 months ago


Expected behavior I would like to use the function stepper.nextStep() (I work under VueJS) Actual behavior But when I initialize with new mdb.Stepper I get an error that mdb is not defined. Resources (screenshots, code snippets etc.)

<script>
import { ref } from "vue";
import {version} from '../../package'

export default {
  setup() {
    let externalScript = document.createElement('script')
    externalScript.setAttribute('src', 'js/mdb.min.js')
    document.head.appendChild(externalScript)
  },
  data: () => ({
appVersion: version,
inscription_form: {

}
  }),
  methods: {
connect() {
  // Je met en place le chargement
  document.getElementById("login_btn").style.display = "none";
  document.getElementById("login_loader").style.display = "block";
},
select_type(type) {
  /*
  * 1 => Restaurateur
  * 2 => Maitre d'hôtel
  */
  this.connect();
}
  },
  created() {
  },
  mounted() {
    const myStepperEl = document.getElementById('stepper');
const stepper = new mdb.Stepper(myStepperEl);
  }
};


Michał Duszak staff answered 8 months ago


Are you sure you're using Stepper for Vue? Here is the documentation: https://mdbootstrap.com/docs/b5/vue/components/stepper/#docsTabsOverview



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • User: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.11.0
  • Device: COMPUTER
  • Browser: CHROME
  • OS: MACOS
  • Provided sample code: No
  • Provided link: No