Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

297
Views
how fix "modal is not a function" in vue.js?

Hello everyone I got this error: [Vue warn]: Error in v-on handler: "TypeError: $(...).modal is not a function". modal is not a fuction Here is my code in welcome.blade.php:

<body>
    <div id="app">
        {{-- This is the vue component --}}
        <new-arrivals></new-arrivals>
    </div>
    <!-- Scripts -->
    <script src="{{ asset('js/app.js') }}" defer></script>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</body>

Here is my js/app.js:

require('./bootstrap');

import Vue from 'vue'
import { VueCtkDateTimePicker } from 'vue-ctk-date-time-picker';
import swal from 'sweetalert2';
import 'vue-ctk-date-time-picker/dist/vue-ctk-date-time-picker.css';
// import $ from 'jquery';
// window.$ = $;
window.Vue = require('vue');
window.swal = swal;
Vue.component('VueCtkDateTimePicker', VueCtkDateTimePicker);
Vue.component('new-arrivals', require('./components/NewArrivals.vue').default);


const app = new Vue({
    el: '#app'
});

Here is my vue script code:

<script type="text/javascript">
import axios from 'axios'

export default {
  data(){
      return {
      }
  },
  methods: {  
    openModal(){
        $('#create_form_modal').modal('show');
    }
  }
}
</script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Here is a similar issue: Bootstrap modal: is not a function

The reason for this problem was the wrong loading order of the scripts. Try to do this in that order

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="{{ asset('js/app.js') }}" defer></script>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!