Comments (5)
Thanks for reporting! I will take a look.
from av-ts.
Strangely I cannot reproduce. Could you provide an example with ComponentsWithMixin and ComponentsWithoutMixin definition?
from av-ts.
The following compiles in ts 2.3.2 but not in 2.4.2 for me:
@Trait class TestTrait extends Vue {}
@Component({
name : 'mixin-component'
})
class MixinComponent extends Mixin(TestTrait) {
}
@Component({
name : 'depend-on-mixin-component',
components : {
MixinComponent
}
})
class DependOnMixin extends Vue {
}
I get the following error in 2.4.2:
Argument of type '{ name: string; components: { MixinComponent: typeof MixinComponent; }; }' is not assignable to parameter of type 'ComponentOptions<Vue> | undefined'.
Type '{ name: string; components: { MixinComponent: typeof MixinComponent; }; }' is not assignable to type 'ComponentOptions<Vue>'.
Types of property 'components' are incompatible.
Type '{ MixinComponent: typeof MixinComponent; }' is not assignable to type '{ [key: string]: typeof Vue | ComponentOptions<Vue> | FunctionalComponentOptions | AsyncComponent...'.
Type '{ MixinComponent: typeof MixinComponent; }' is not assignable to type '{ [key: string]: typeof Vue | ComponentOptions<Vue> | FunctionalComponentOptions | AsyncComponent...'.
Property 'MixinComponent' is incompatible with index signature.
Type 'typeof MixinComponent' is not assignable to type 'typeof Vue | ComponentOptions<Vue> | FunctionalComponentOptions | AsyncComponent'.
Type 'typeof MixinComponent' is not assignable to type 'AsyncComponent'.
Type 'typeof MixinComponent' provides no match for the signature '(resolve: (component: Component) => void, reject: (reason?: any) => void): void | typeof Vue | ComponentOptions<Vue> | FunctionalComponentOptions | Promise<Component>'.
I tried looking though the definitions, but not quite sure what the problem is. It might be that VClass, which the Mixin function returns, does not extend Vue or ComponentOption? I cant quite wrap my head around it though.
from av-ts.
It seems quite hard to fix. The problem is mixin pattern cannot handle static property well...
from av-ts.
I come up with a method to add static method! Released as 0.9.1.
from av-ts.
Related Issues (20)
- Static class properties are undefined HOT 2
- howto no data props - question HOT 4
- Lifecycle methods give error TS1241 HOT 3
- @Component decorator requires `template` key HOT 3
- Compiler error watching nested optional value HOT 2
- p({type: String}) doesn't work as expected HOT 1
- Try to improve `p` definition. HOT 1
- Some webpack related issue started from v0.8.0 HOT 2
- Failing unit tests on PhantomJS since av-ts 0.8.x HOT 5
- TypeError: 'caller' and 'arguments' are restricted function properties and cannot be accessed in this context. HOT 2
- @Lifecycle problem HOT 1
- Anything has to do to work with Vue 2.5? HOT 2
- @Data throws TS2345 about "Dict" when "strict: true" HOT 3
- Support `next(false)` in `beforeRouteEnter`
- how to write mapState function in vuex?? HOT 3
- TS3.0 introduced generic rest parameters HOT 3
- @Watch('value') warning: Argument type 'value' is not assignable to [string,string,string,string] HOT 1
- Is project alive? HOT 1
- Props throw `TypeError: Cannot redefine property: xxx` (with workaround) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from av-ts.