1 | # TypeScript plugin
|
2 |
|
3 | Please add this config to your `tsconfig.json`:
|
4 |
|
5 | ```json
|
6 | {
|
7 | "compilerOptions": {
|
8 | "allowJs": true
|
9 | }
|
10 | }
|
11 | ```
|
12 |
|
13 | In `src/main.ts` you need to add `any` type on `ssrContext` variable:
|
14 |
|
15 | ```js
|
16 | export function createApp(ssrContext: any) {
|
17 | // ...
|
18 | }
|
19 | ```
|
20 |
|
21 | ## Vue class components
|
22 |
|
23 | A small helper exists in `src/vueclass.ts` to use Vue class components:
|
24 |
|
25 | ```js
|
26 | import { Vue, Component } from '@/vueclass';
|
27 |
|
28 | @Component
|
29 | export class SomePage extends Vue {
|
30 | async asyncData() {
|
31 | return {
|
32 | foo: 'bar',
|
33 | };
|
34 | }
|
35 | }
|
36 | ```
|
37 |
|
38 | You can use decorators from:
|
39 |
|
40 | - vue-class-component
|
41 | - vue-property-decorator
|
42 | - vuex-class
|