前提・実現したいこと
Nuxt+TypeScriptの環境構築を行なっているのですが、
import文にて、Cannot find module '~/components/Logo.vue'.ts(2307)というエラーが発生します。
pathはあっているので、何故moduleを見つけられないのか不明です。
ご教示いただけますと幸いです。
作業中のGitHubです。
https://github.com/mogataro/typescript-app
発生している問題・エラーメッセージ
Cannot find module '~/components/Logo.vue'.ts(2307) Cannot find module '~/components/VuetifyLogo.vue'.ts(2307)
該当のソースコード
index.ts
ts
1import { Component, Vue } from 'nuxt-property-decorator' 2import Logo from '~/components/Logo.vue' 3import VuetifyLogo from '~/components/VuetifyLogo.vue' 4 5@Component({ 6 components: { 7 Logo, 8 VuetifyLogo 9 } 10}) 11export default class extends Vue { 12 mounted() { 13 console.log('typescriptです') 14 } 15}
index.vue
vue
1<template> 2 <v-layout column justify-center align-center> 3 <v-flex xs12 sm8 md6> 4 <div class="text-center"> 5 <logo /> 6 <vuetify-logo /> 7 </div> 8 <v-card> 9 <v-card-title class="headline"> 10 Welcome to the Vuetify + Nuxt.js template 11 </v-card-title> 12 <v-card-text> 13 <p> 14 Vuetify is a progressive Material Design component framework for 15 Vue.js. It was designed to empower developers to create amazing 16 applications. 17 </p> 18 <p> 19 For more information on Vuetify, check out the 20 <a href="https://vuetifyjs.com" target="_blank"> documentation </a>. 21 </p> 22 <p> 23 If you have questions, please join the official 24 <a href="https://chat.vuetifyjs.com/" target="_blank" title="chat"> 25 discord </a 26 >. 27 </p> 28 <p> 29 Find a bug? Report it on the github 30 <a 31 href="https://github.com/vuetifyjs/vuetify/issues" 32 target="_blank" 33 title="contribute" 34 > 35 issue board </a 36 >. 37 </p> 38 <p> 39 Thank you for developing with Vuetify and I look forward to bringing 40 more exciting features in the future. 41 </p> 42 <div class="text-xs-right"> 43 <em><small>— John Leider</small></em> 44 </div> 45 <hr class="my-3" /> 46 <a href="https://nuxtjs.org/" target="_blank"> 47 Nuxt Documentation 48 </a> 49 <br /> 50 <a href="https://github.com/nuxt/nuxt.js" target="_blank"> 51 Nuxt GitHub 52 </a> 53 </v-card-text> 54 <v-card-actions> 55 <v-spacer /> 56 <v-btn color="primary" nuxt to="/inspire"> 57 Continue 58 </v-btn> 59 </v-card-actions> 60 </v-card> 61 </v-flex> 62 </v-layout> 63</template> 64 65<script lang="ts" src="./index.ts" /> 66
補足情報(FW/ツールのバージョンなど)
エディタ:vscode
Nuxt.js v2.8.1
│ Running in development mode (spa)
│ TypeScript support is enabled
作業中のGitHubです。
https://github.com/mogataro/typescript-app
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/10/12 22:03