Skip to content

Commit

Permalink
feat(parser): parse typescript 3.7 shipped proposals
Browse files Browse the repository at this point in the history
  • Loading branch information
cilice authored and rchl committed Nov 17, 2019
1 parent f6ce90b commit a69a8fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/helpers/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ exports.extractComponentOptions = (path) => {
const parsed = parser.parse(script, {
sourceType: 'module',
plugins: [
'nullishCoalescingOperator',
'optionalChaining',
'classProperties',
'decorators-legacy',
'dynamicImport',
Expand Down
7 changes: 7 additions & 0 deletions test/fixture/typescript/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
const doSomething = async (): Promise<any> => {}
@Component({
nuxtI18n: {
paths: {
Expand All @@ -20,8 +22,13 @@ import { Component, Vue } from 'vue-property-decorator'
}
})
export default class Home extends Vue {
pages: Array<any> = []
async mounted() {
await (this as any).$message.info('This is a normal message')
const result = await doSomething()
this.pages = result.data?.pages ?? []
}
}
</script>

0 comments on commit a69a8fb

Please sign in to comment.