https://v2.vuejs.org/v2/examples/select2.html
虽然我在页面中使用Vue组件,但我并没有制作SPA。
我得到这个错误
Error in mounted hook: "TypeError: $(...).select2 is not a function"
found in <Select2> at
C:\laragon\www\lara\resources\assets\js\components\ui\Select2.vue
我在html文件中包括select2和我的VUEJ:
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
<script src="{{ asset('js/content_type_blocks.js') }}?{{ str_random(7) }}"></script>
我想知道为什么我会得到错误,select2不是一个函数?