This extension adds typescript support to a quasar project with minimum configuration
- Add extension to your dependencies:
npm install -D git+ssh://github.com:thibautguedou3/quasar-typescript-extension.git
- Then invoke the extension in your quasar project:
quasar ext invoke cood-typescript-ext
- Add
lang="ts"
to the script tag in a.vue
file and change the export default:
<script lang="ts">
import Vue from "vue";
interface IData {
message: string;
}
export default Vue.extend({
name: "PageIndex",
data(): IData {
return {
message: "Hello"
};
}
});
</script>
- Then run:
quasar dev
- It should compile with no error
quasar ext remove cood-typescript-ext
The typescript errors in .vue
files will only appear in vetur and during the webpack compilation. You will not see them when running the tsc
command
If you appreciate the work that went into this App Extension, please consider donating to Quasar.