UNPKG

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