Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
168 views
in Technique[技术] by (71.8m points)

如何在vue组件里面使用typescript

我在vue文件里面的 script标签里面想使用typescript:

<script lang="ts">
//lang="typescript"也不行
namespace M{
//...
}
</script>

但是用webpack打包的时候报You may need an appropriate loader to handle this file type. 找不到对应的加载器,可我在 单独require或import时 可以成功转换。 webpack配置:
clipboard.png
还需要单独配置吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

https://github.com/Herrington... 这个有没有帮助?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...