我收到此错误:Uncaught ReferenceError:我声明全局变量时未定义vue

时间:2018-12-21 20:00:15

标签: laravel vue.js

在我声明全局过滤器Uncaught ReferenceError之前,代码可以正常工作

require('./bootstrap');

window.Vue = require('vue');

import { Form, HasError, AlertError } from 'vform'

import Vue from 'vue'
import VueRouter from 'vue-router'

//global components
Window.Form = Form;
Vue.component(HasError.name, HasError)
Vue.component(AlertError.name, AlertError)

这是错误的来源:vue过滤器会产生未捕获的错误参考,vue未定义

vue.filter('capitalize', function (text) {
    return text.toUpperCase();
})

// explicit installation of Router via Vue.use()
Vue.use(VueRouter)

0 个答案:

没有答案