Vue中常见问题汇总及解决方案(一)

目录

安装超时(install timeout)

安装一些需要编译的包: 提示没有安装python、build失败等

can’t not find ‘xxModule’ - 找不到某些依赖或者模块

data functions should return an object

我给组件内的原生控件添加事件, 怎么不生效了!!!

我用了 axios , 为什么 IE 浏览器不识别(IE9+)

我在函数内用了this.xxx=, 为什么抛出Cannot set property ‘xxx’ of undefined;

我看一些Vue教程有这么些写法, 是什么意思@click.prevent, v-demo.a.b; 

为什么我的引入的小图片渲染出来却是 data:image/png; base64xxxxxxxx

Component template shold contain exactly one root element. If you are useing v-if on multiple elements , xxxxx

跨域问题怎么破! 比如No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

我需要遍历的数组值更新了, 值也赋值了, 为什么视图不更新!

为什么我的组件间的样式不能继承或者覆写啊!

路由模式改为history后, 除了首次启动首页没报错, 刷新访问路由都报错!

我想拦截页面, 或者在页面进来之前做一些事情, 可以么?

TypeError: xxx is not a function

Uncaught ReferenceError: xxx is not define

Error in render function:”Type Error: Cannot read property ‘xxx’ of undefined”

Unexpected token: operator xxxxx

npm run build之后不能直接访问


  1. 安装超时(install timeout)
    国内淘宝镜像:https://registry.npm.taobao.org
  2. 安装一些需要编译的包: 提示没有安装python、build失败等
    安装 Python
    确保您的系统上已安装 Python。可以在终端中运行 python --version 查看 Python 版本。
    如果没有安装 Python,请前往 Python 官网下载并安装合适的版本。
    安装构建工具
    在 Windows 上,您需要安装 Microsoft Visual C++ 构建工具。可以从 Visual Studio 下载页面下载并安装。
    在 macOS 上,您需要安装 Xcode 命令行工具。可以在终端中运行 xcode-

你可能感兴趣的:(Vue实战,vue.js,前端,javascript)