Laravel 5 无法将vee validate与laravel 5.4一起使用
我是vue新手,正在尝试将其集成到我的一个项目中,我正在使用Laravel 5.4。我使用vee validate进行验证。我用纱线来管理包裹。当我在npm运行dev后访问页面时,firebug控制台栏中出现以下错误:Laravel 5 无法将vee validate与laravel 5.4一起使用,laravel-5,vuejs2,Laravel 5,Vuejs2,我是vue新手,正在尝试将其集成到我的一个项目中,我正在使用Laravel 5.4。我使用vee validate进行验证。我用纱线来管理包裹。当我在npm运行dev后访问页面时,firebug控制台栏中出现以下错误: TypeError: value is undefined (this one is in app.js file) ReferenceError: require is not defined (this one is in plugin.js f
TypeError: value is undefined (this one is in app.js file)
ReferenceError: require is not defined (this one is in plugin.js file)
这是我的app.js文件:
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./bootstrap');
import VeeValidate from 'vee-validate'
Vue.use(VeeValidate);
/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
* or customize the JavaScript scaffolding to fit your unique needs.
*/
Vue.component('example', require('./components/Example.vue'));
Vue.component('form-account-create', require('./components /CreateAccount.vue'));
const app = new Vue({
el: '#app'
});
这是我的webpack.mix.js文件:
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
//copying the font-awesome fonts
mix.copy('./node_modules/font-awesome/fonts', 'public/bulids/fonts');
/**
* concatenating multiple plugins css into one file
*/
mix.styles([
'./node_modules/metismenu/dist/metisMenu.min.css',
'./node_modules/gritter/css/jquery.gritter.css',
'./resources/assets/css/animate.css',
'./resources/assets/css/style.css',
'./resources/assets/css/custom.css'
], 'public/css/plugins.css');
/**
* concatenating multiple plugins js into one file
*/
mix.scripts([
'./node_modules/metismenu/dist/metisMenu.js',
'./node_modules/slimscroll/lib/slimscroll.js',
'./node_modules/gritter/js/jquery.gritter.js',
'./resources/assets/js/inspinia/inspinia.js',
'./node_modules/pace/pace.js',
'./resources/assets/plugins/jquery-ui/jquery-ui.min.js'
/* './resources/assets/js/inspinia/custom.js' */
], 'public/js/plugins.js');
我目前正处于这一点上,不知道如何解决这些问题。非常感谢您的帮助。感谢您抽出时间阅读此问题。此存储库有效:
您应该从“vee validate”输入
import vee validate代码>
在window.Vue=require('Vue')下代码>
pace.js或pace.min.js文件应为手动下载()。
因为
npm install pace
中的pace.js包含的代码require('charm')
不允许客户端使用