Vetur: variables from mixins not recognized in component template

Created on 24 Apr 2019  路  6Comments  路  Source: vuejs/vetur

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
feature-request template-interpolation

Most helpful comment

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

All 6 comments

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

I guess roll-back to 0.18.1 for now if needed

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

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

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. . .

Related to #1156

Was this page helpful?
0 / 5 - 0 ratings