microsoft / TypeScript-Vue-Starter

A starter template for TypeScript and Vue with a detailed README describing how to use the two together.
MIT License
4.45k stars 592 forks source link

Not able to use decorators to define a component #35

Closed ali-mansur closed 6 years ago

ali-mansur commented 6 years ago

Was giving a try for https://github.com/Microsoft/TypeScript-Vue-Starter#using-decorators-to-define-a-component

I see error:

TS1238: Unable to resolve signature of class decorator when called as an expression. Type '<VC extends VueClass<{}>>(target: VC) => VC' is not assignable to type 'typeof HelloDecorator'. Property 'extend' is missing in type '<VC extends VueClass<{}>>(target: VC) => VC'.

I am using Typescript version: 2.7.1

//Hello.vue

screen shot 2018-02-10 at 2 45 58 pm

// tsconfig.json

screen shot 2018-02-10 at 3 30 03 pm
pboymt commented 6 years ago

I had same problem

hbelitzisap commented 6 years ago

I also ran into the same error with TypeScript 2.7.1. This works just fine when using TypeScript 2.6.2.

elevatebart commented 6 years ago

How about importing Vue from vue ?

import Vue from 'vue';
ghost commented 5 years ago

image doc