vue-cli-3-nuxt-typescript icon indicating copy to clipboard operation
vue-cli-3-nuxt-typescript copied to clipboard

TS loader does not work with vue files

Open iSynth opened this issue 7 years ago • 1 comments

My index.vue file:

<template>
    <section>
        INDEX
    </section>
</template>

<script lang="ts">

    import { Component, Vue } from 'nuxt-property-decorator'

    @Component({})
    export default class Index extends Vue {

    }
</script>

My tsconfig.json file:

.....

"experimentalDecorators": true,
 "emitDecoratorMetadata" : true
.....

I got this error message

Module parse failed: Unexpected character '@' (11:0) You may need an appropriate loader to handle this file type. | import { Component, Vue } from 'nuxt-property-decorator' |

@Component({} | ) | export default class Index extends Vue {

iSynth avatar Sep 27 '18 16:09 iSynth

I'm sorry, I've updated my repository, if you're able to recheck if it works now, I'd be happy. I've also added some documentation on where I've gotten my input from, who laid the work for getting to this.

pkej avatar Dec 02 '18 11:12 pkej