Vue.js 未检测到vue.config.js上的插件
我正在使用VUE3进行一个项目。在某些情况下,我需要Vue.js 未检测到vue.config.js上的插件,vue.js,Vue.js,我正在使用VUE3进行一个项目。在某些情况下,我需要 ,因此我将其导入到vue组件文件中 <template> <div> <!-- --> </div> </template> <script> // .. import 'bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js' import '
,因此我将其导入到vue组件文件中
<template>
<div>
<!-- -->
</div>
</template>
<script>
// ..
import 'bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js'
import 'bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker.css'
// ..
</script>
我在命令行提示符上没有发现错误。但我确实在浏览器控制台上遇到了一些错误
vue router.esm.js?8c4f:1905 ReferenceError:未定义jQuery
评估时(引导材料datetimepicker.js?5260:1295)
在Object../node_modules/bootstrap material datetimepicker/js/bootstrap-material-datetimepicker.js(vendors~PublicSignUp.js:76)
在网页上需要(app.js:768)
在fn(app.js:131)
评估时(cjs.js?!。/node_modules/babel loader/lib/index.js!。/node_modules/cache loader/dist/cjs.js?!。/node_modules/vue loader/lib/index.js?!。/src/pages/public/SignUp.vue?vue&type=script&lang=js&:6)
在Module../node_modules/cache loader/dist/cjs.js/node_modules/babel loader/lib/index.js/node_modules/cache loader/dist/cjs.js/node_modules/vue loader/lib/index.js/src/pages/public/SignUp.vue?vue&type=script&lang=js&(PublicSignUp.js:11)
在网页上需要(app.js:768)
在fn(app.js:131)
评估时(注册号:vue?8585:1)
在Module../src/pages/public/SignUp.vue?vue&type=script&lang=js&(PublicSignUp.js:80)
有人能帮我吗?刚刚看到,我只需要将插件
包装在配置网页包中
const webpack = require('webpack');
module.exports = {
baseUrl: '/public/',
configureWebpack: {
plugins: [
new webpack.ProvidePlugin({
'$': 'jquery',
'jquery': 'jquery',
'jQuery': 'jquery',
'window.jQuery': 'jquery',
'moment': 'moment'
})
]
}
}
const webpack = require('webpack');
module.exports = {
baseUrl: '/public/',
configureWebpack: {
plugins: [
new webpack.ProvidePlugin({
'$': 'jquery',
'jquery': 'jquery',
'jQuery': 'jquery',
'window.jQuery': 'jquery',
'moment': 'moment'
})
]
}
}