vetur icon indicating copy to clipboard operation
vetur copied to clipboard

variables from mixins not recognized in component template

Open dpatwp opened this issue 5 years ago • 7 comments

Info

  • Platform: Linux
  • Vetur version: 0.19.0
  • VS Code version: 1.33.1

Problem

Since the last release of Vetur html template no longer uses values from mixins

example error in template where mixin has data.config Property 'config' does not exist on type 'CombinedVueInstance...'.

Reproducible Case

  • create a base component with a data and/or computed variable
  • create a extends component that uses the base component as a mixin
  • use variable/computed in template of extends component

dpatwp avatar Apr 24 '19 18:04 dpatwp

That's correct, there's no support for mixin yet. It's not easy to do this...

octref avatar Apr 24 '19 21:04 octref

I guess roll-back to 0.18.1 for now if needed

dasDaniel avatar Apr 24 '19 21:04 dasDaniel

You can also do vetur.validation.template: false or vetur.experimental.templateInterpolationService: false

octref avatar Apr 24 '19 22:04 octref

FYI: If you want to type mixins, you may want to use this. https://github.com/ktsn/vue-typed-mixins

ktsn avatar Apr 26 '19 15:04 ktsn

I am using mac. After I upgraded to the latest vscode, I also encountered this problem. Now, whether I downgrade to 1.3.1 or use vetur0.18.1, the properties of mixins are always unrecognizable. . .

ClausClaus avatar Apr 28 '19 13:04 ClausClaus

Related to #1156

octref avatar May 23 '19 05:05 octref

You can also do vetur.validation.template: false or vetur.experimental.templateInterpolationService: false

Hm, I tried that and I still get errors regarding a property not being on type. I'm not using TypeScript.

Also, where can I find all the settings Vetur supports?

boneus avatar Jun 16 '22 10:06 boneus