Skip to content

Roninii/vue-typescript-cheatsheet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

vue-typescript-cheatsheet

Cheatsheets for experienced Vue developers getting started with TypeScript

Recommended ts.config setup

note: strict:true stricter inference for data properties on this. If you do not use it, this will always be treated as any

// tsconfig.json
{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "strict": true,
    "moduleResolution": "node"
  }
}

Usage in .vue files

add lang="ts" to the script tag to declare TS as the lang used.

<script lang="ts">
  ...
</script>

use defineComponent to get type inference in Vue component options

import { defineComponent } from 'vue'

const Component = defineComponent({
  // type inference enabled
})

About

(seeking maintainers) Cheatsheets for experienced Vue developers getting started with TypeScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy