【Vue】VueCli3 + Vue + typescript 挖坑记
栏目: JavaScript · 发布时间: 7年前
内容简介:VueCli3.0生成Vue+ts的项目组件,中间遇到了一些让我直接放弃结合ts的坑,还是等Vue3.0的发布吧,到那个时候肯定结合得会更好。1 How to fix TSLint: " should be ' (quotemark) while doing organize imports in code editors?In User Preferences set the following.
Vue + typescript 挖坑记
VueCli3.0生成Vue+ts的项目组件,中间遇到了一些让我直接放弃结合ts的坑,还是等Vue3.0的发布吧,到那个时候肯定结合得会更好。
1 How to fix TSLint: " should be ' (quotemark) while doing organize imports in code editors?
In User Preferences set the following.
"tslint.autoFixOnSave": true
2 tslint Missing semicolon (semicolon)
分析:在vuetur的github>issue中有讲,vue-tslint的代码检查不太好,强制要求每个vue单文件组件里必须要有以下代码
<script lang="ts"> </script>
3 App.vue' is not a module.
分析:弄完第二个问题后,cli紧接着就报了这个错误。想了解的话,请戳vuecli_ts > Github上的这个 Issue ,下面给了一种临时性的解决方案(真的挺丑的),真正的解决还是得等vue3.0的正式发布。
解决方法:// @ts-ignore before each import '*.vue' could be a temporary solution.
// @ts-ignore import HelloWorld from '@/components/HelloWorld/HelloWorld.vue';
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Fluent Python
Luciano Ramalho / O'Reilly Media / 2015-8-20 / USD 39.99
Learn how to write idiomatic, effective Python code by leveraging its best features. Python's simplicity quickly lets you become productive with it, but this often means you aren’t using everything th......一起来看看 《Fluent Python》 这本书的介绍吧!
Base64 编码/解码
Base64 编码/解码
MD5 加密
MD5 加密工具