2
0

More than 1 year has passed since last update.

Vue.jsにあとからTypeScriptを導入する

Posted at

Vue.jsはフォルダを作るときにtypescriptを導入するか聞いてくるが、後から導入したくなったときの方法をかく。

vue add @vue/typescript

このコマンドを打つだけ。

何やらいろいろ聞いてくる。

// classスタイルで定義するかどうか
? Use class-style component syntax? 
//Babelを使うか
? Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)? 
//既存のjsファイルをtsファイルにしていいか
? Convert all .js files to .ts?  
//jsファイルをコンパイルに含めるか
? Allow .js files to be compiled?
// 宣言ファイルの型チェックをスキップするかどうか
? Skip type checking of all declaration files (recommended for apps)? 

勝手にtsファイルにしてくれた。
rapture_20211206112424.png

参考
https://lunchbox.qnv.pw/2021/03/17/vuejs-typescript/

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0