【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';

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Beginning XSLT 2.0

Beginning XSLT 2.0

Jeni Tennison / Apress / 2005-07-22 / USD 49.99

This is an updated revision of Tennison's "Beginning XSLT", updated for the new revision of the XSLT standard. XSLT is a technology used to transform an XML document with one structure into another ......一起来看看 《Beginning XSLT 2.0》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

在线进制转换器
在线进制转换器

各进制数互转换器

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具