【发布时间】:2017-06-19 12:50:17
【问题描述】:
我一直在尝试将 Vue.js 与 TypeScript 一起使用,但遇到了this repo。
我在这里遇到了从 TypeScript 导入 Vue 单组件文件时出错的问题。我正在使用 Visual Studio 代码。请参阅下面的错误。
main.ts:
// The Vue build version to load with the 'import' command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import * as Vue from 'vue'
import App from './App'
/* eslint-disable no-new */
new Vue({
el: '#app',
template: '<App/>',
components: { App }
})
VS 代码错误:
1 ERROR • main.ts [ts] Cannot find module './App'. (4 17)
【问题讨论】:
标签: javascript typescript vue.js