Vetur: Support scoped slot on template diagnostic

Created on 15 Apr 2019  路  8Comments  路  Source: vuejs/vetur

It currently just ignores slot-scope and v-slot. We need to add declared variables by scoped slot in local scope.

<template>
  <MyComp v-slot="{ foo }"> <!-- foo will be in local scope -->
    <p>{{ foo }}</p> <!-- should not provide error here -->
  </MyComp>
</template>
diagnostics template-interpolation

Most helpful comment

I already made a PR #1210 which supports both v-slot and slot-scope.

All 8 comments

Is my following issue related to this?

Screen Shot 2019-04-24 at 2 08 38 PM

This behaviour just started today and I can't figure out why... If this isn't related, let me know and I'll open a new issue.

EDIT: I just noticed that this issue is new w/ 0.19.0, as it isn't present in 0.18.1

Yes.

Also ran into this today.

Screenshot 2019-04-25 at 11 35 31

+1, also getting this issue:

image

but i use vue 2.5 cant support v-slot

I already made a PR #1210 which supports both v-slot and slot-scope.

I still get an error when I use slot variables for v-bind:class
image
image
image

@mrg0lden

Got the same issue too.

However, the problem doesn't exist if v-slot is used inside the template element, e.g.

<editor-menu-bar
  :editor="editor"
>
  <template v-slot="{commands, isActive, focused}">
    ...
  </template>
</editor-menu-bar>

I have logged a new issue here: https://github.com/vuejs/vetur/issues/2094

Was this page helpful?
0 / 5 - 0 ratings