vueJS知识(vue2部分跟学尚硅谷尚品汇)

1.首先安装vue脚手架, cnpm install -g @vue/cli;(目前是5.0版本)

vue2部分

2.vue新建项目时,用vue create app(新建APP项目),里面的内容可以用y或n选择是否使用模块;

项目完成后会提示 cd app ; 这个命令是进入当前文件下的下个文件目录;

然后运行 npm run serve命令,这个是运行这个项目。

在package.json中修改serve配置:"serve": "vue-cli-service serve --open",结果跳转到0.0.0.0网页,无法打开.百度了一下,如下操作即可,不过network地址变成了本地的.(没找到其他的方法).

在vue.config.js中新增以下代码(我的自带有这个文件,没有的自己创建):

module.exports = {
  devServer: {        
    host: 'localhost',
    port: 8080,
    https: false,
    hot: false,
    proxy: null
  },

}

3.报错:TypeScript intellisense is disabled on template. To enable, configure `"jsx": "preserve"` in the `"compilerOptions"` property of tsconfig or jsconfig. To disable this prompt instead, configure `"experimentalDisableTemplateSupport": true` in `"vueCompilerO

在jsconfig.json中添加 "jsx": "preserve",属性即可

4.在HTML页面报错:localhost/:1 Refused to apply style from 'http://localhost:8080/iconfont.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.结果发现是reset.css里面引入了这个css,注释即可.

 

 5.看弹幕说vue-router4版本对vue2不太支持,所以我下载了3的版本,如果你们没问题,可以忽略.

cnpm i --save vue-router

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值