Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support vue-class-component #185

Closed
Christilut opened this issue Apr 19, 2020 · 5 comments
Closed

Support vue-class-component #185

Christilut opened this issue Apr 19, 2020 · 5 comments
Labels

Comments

@Christilut
Copy link

Describe

I'm using vue-class-component but this plugin doesn't seem to work with it.

I always get this error: Invalid prop: type check failed for prop "dataComponent". Expected Object, got Function

I saw another issue with the same error but I don't think this problem is solved yet.

To Reproduce

      VirtualList(
        :size='161'
        :keeps='20'
        data-key='id'
        :data-sources='items'
        :data-component='itemComponent'
        )

...

import Item from './Item.vue'

export default class MyClass extends Mixins(MyMixin) {
  itemComponent: any = Item
}
@Component({})
export default class ResultItem extends Vue {
  @Prop()
  source: any
}

Other

  • Browser: Electron 6
    "vue-virtual-scroller": "^1.0.10",
    "vue-class-component": "7.2.2",
    "vue-template-compiler": "2.6.11",
    "vue": "2.6.11",
@Christilut Christilut added the bug label Apr 19, 2020
tangbc added a commit that referenced this issue Apr 19, 2020
@tangbc
Copy link
Owner

tangbc commented Apr 19, 2020

Fixed in v2.0.8

@tangbc tangbc closed this as completed Apr 19, 2020
@Christilut
Copy link
Author

Does this fix it or just remove the warning? Because the plugin doesn't work at all currently with the class component

@tangbc
Copy link
Owner

tangbc commented Apr 19, 2020

Yes, just add props type, but I don't know about vue-class-component a lot, so I have to learn more, maybe it will take some time.

@tangbc tangbc added feature and removed bug labels Apr 19, 2020
@tangbc tangbc changed the title Invalid prop: type check failed for prop "dataComponent". Expected Object, got Function Support vue-class-component Apr 19, 2020
@tangbc tangbc reopened this Apr 19, 2020
@Christilut
Copy link
Author

I can make a minimal repro if you want. Just let me know 👍

@ciel69
Copy link

ciel69 commented Jul 20, 2020

It works for me

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

  @Prop(Number)
  readonly index?: Number;

  @Prop({default: {}})
  source!: Object;

}

@tangbc tangbc closed this as completed Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants