webstrom编译.vue遇到的报错问题

1.webstorm中.vue文件中写stylus,总是出现警告和错误,但不影响编译

这里写图片描述
解决方案1:
装个vue插件,idea 里面插件名:vue-for-idea

解决方案2:
新版本的webstorm(2012以上)可用下面的方式解决:

<style lang="stylus" rel="stylesheet/stylus">

2.不能在.vue文件中注释以及空格报错问题

解决方案1:

1.安装Vue 2 Snippets插件

2.在settings.json中加入这个:

"files.associations": {
    "*.vue": "html" }

对,你没有看错,不是vue,是html

3.然后,再去编辑窗口,看看效果:既有vue的提示,又能像普通html那样正确注释!

解决方案2:

修改文件
这里写图片描述

3.使用ES6的箭头函数写Vue组件提示错误

这里写图片描述
解决方法
这里写图片描述
这里写图片描述
<script>改写成<script type="text/ecmascript-6">

箭头函数:https://blog.csdn.net/wangxiaoxiaosen/article/details/77983148

扫描二维码关注公众号,回复: 2835607 查看本文章

猜你喜欢

转载自blog.csdn.net/qq_42624874/article/details/81779513