Ambiguous combined usage of slot-scope and v-for on (v-for takes higher priority). Use a wrapper for the...











up vote
0
down vote

favorite












In my Nuxt.js application, I use Vuetify.js. Here is the piece of code that causes me trouble:



<v-list dense>
<v-hover>
<v-list-tile
v-for="menuItem in menuItems"
:key="menuItem.title"
slot-scope="{ hover }"
:class="`elevation-${hover ? 12 : 0}`">

<v-list-tile-action>
<v-icon> {{menuItem.icon }} </v-icon>
</v-list-tile-action>

<v-list-tile-content>
<v-list-tile-title>{{ menuItem.title }}</v-list-tile-title>
</v-list-tile-content>

</v-list-tile>
</v-hover>
</v-list>


That triggers this error message:




(Emitted value instead of an instance of Error) Ambiguous combined
usage of slot-scope and v-for on (v-for takes higher
priority). Use a wrapper for the scoped slot to make it
clearer.




The code works fine when I remove the v-hover component.



I read the error message and I tried to do what it suggests:



<template
slot-scope="{ hover }"
:class="`elevation-${hover ? 12 : 0}`">
<!--
Wrap v-list-tile-action and v-list-tile-content code here
-->
</template>


But I faced other issues.



Any idea on how to fix it?










share|improve this question
























  • At hover should all tiles have same class or are you going to emphasise only the one currently hovered?
    – barbsan
    Nov 8 at 11:53










  • I presume you should put v-for on v-hover or wrap list inside the v-hover.
    – Traxo
    Nov 8 at 12:22








  • 1




    @BillalBegueradj It seemed weird but I asked whether they all should share the same class
    – barbsan
    Nov 8 at 12:59

















up vote
0
down vote

favorite












In my Nuxt.js application, I use Vuetify.js. Here is the piece of code that causes me trouble:



<v-list dense>
<v-hover>
<v-list-tile
v-for="menuItem in menuItems"
:key="menuItem.title"
slot-scope="{ hover }"
:class="`elevation-${hover ? 12 : 0}`">

<v-list-tile-action>
<v-icon> {{menuItem.icon }} </v-icon>
</v-list-tile-action>

<v-list-tile-content>
<v-list-tile-title>{{ menuItem.title }}</v-list-tile-title>
</v-list-tile-content>

</v-list-tile>
</v-hover>
</v-list>


That triggers this error message:




(Emitted value instead of an instance of Error) Ambiguous combined
usage of slot-scope and v-for on (v-for takes higher
priority). Use a wrapper for the scoped slot to make it
clearer.




The code works fine when I remove the v-hover component.



I read the error message and I tried to do what it suggests:



<template
slot-scope="{ hover }"
:class="`elevation-${hover ? 12 : 0}`">
<!--
Wrap v-list-tile-action and v-list-tile-content code here
-->
</template>


But I faced other issues.



Any idea on how to fix it?










share|improve this question
























  • At hover should all tiles have same class or are you going to emphasise only the one currently hovered?
    – barbsan
    Nov 8 at 11:53










  • I presume you should put v-for on v-hover or wrap list inside the v-hover.
    – Traxo
    Nov 8 at 12:22








  • 1




    @BillalBegueradj It seemed weird but I asked whether they all should share the same class
    – barbsan
    Nov 8 at 12:59















up vote
0
down vote

favorite









up vote
0
down vote

favorite











In my Nuxt.js application, I use Vuetify.js. Here is the piece of code that causes me trouble:



<v-list dense>
<v-hover>
<v-list-tile
v-for="menuItem in menuItems"
:key="menuItem.title"
slot-scope="{ hover }"
:class="`elevation-${hover ? 12 : 0}`">

<v-list-tile-action>
<v-icon> {{menuItem.icon }} </v-icon>
</v-list-tile-action>

<v-list-tile-content>
<v-list-tile-title>{{ menuItem.title }}</v-list-tile-title>
</v-list-tile-content>

</v-list-tile>
</v-hover>
</v-list>


That triggers this error message:




(Emitted value instead of an instance of Error) Ambiguous combined
usage of slot-scope and v-for on (v-for takes higher
priority). Use a wrapper for the scoped slot to make it
clearer.




The code works fine when I remove the v-hover component.



I read the error message and I tried to do what it suggests:



<template
slot-scope="{ hover }"
:class="`elevation-${hover ? 12 : 0}`">
<!--
Wrap v-list-tile-action and v-list-tile-content code here
-->
</template>


But I faced other issues.



Any idea on how to fix it?










share|improve this question















In my Nuxt.js application, I use Vuetify.js. Here is the piece of code that causes me trouble:



<v-list dense>
<v-hover>
<v-list-tile
v-for="menuItem in menuItems"
:key="menuItem.title"
slot-scope="{ hover }"
:class="`elevation-${hover ? 12 : 0}`">

<v-list-tile-action>
<v-icon> {{menuItem.icon }} </v-icon>
</v-list-tile-action>

<v-list-tile-content>
<v-list-tile-title>{{ menuItem.title }}</v-list-tile-title>
</v-list-tile-content>

</v-list-tile>
</v-hover>
</v-list>


That triggers this error message:




(Emitted value instead of an instance of Error) Ambiguous combined
usage of slot-scope and v-for on (v-for takes higher
priority). Use a wrapper for the scoped slot to make it
clearer.




The code works fine when I remove the v-hover component.



I read the error message and I tried to do what it suggests:



<template
slot-scope="{ hover }"
:class="`elevation-${hover ? 12 : 0}`">
<!--
Wrap v-list-tile-action and v-list-tile-content code here
-->
</template>


But I faced other issues.



Any idea on how to fix it?







javascript vue.js vuetify.js






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 8 at 11:37

























asked Nov 8 at 11:30









Billal Begueradj

5,511132637




5,511132637












  • At hover should all tiles have same class or are you going to emphasise only the one currently hovered?
    – barbsan
    Nov 8 at 11:53










  • I presume you should put v-for on v-hover or wrap list inside the v-hover.
    – Traxo
    Nov 8 at 12:22








  • 1




    @BillalBegueradj It seemed weird but I asked whether they all should share the same class
    – barbsan
    Nov 8 at 12:59




















  • At hover should all tiles have same class or are you going to emphasise only the one currently hovered?
    – barbsan
    Nov 8 at 11:53










  • I presume you should put v-for on v-hover or wrap list inside the v-hover.
    – Traxo
    Nov 8 at 12:22








  • 1




    @BillalBegueradj It seemed weird but I asked whether they all should share the same class
    – barbsan
    Nov 8 at 12:59


















At hover should all tiles have same class or are you going to emphasise only the one currently hovered?
– barbsan
Nov 8 at 11:53




At hover should all tiles have same class or are you going to emphasise only the one currently hovered?
– barbsan
Nov 8 at 11:53












I presume you should put v-for on v-hover or wrap list inside the v-hover.
– Traxo
Nov 8 at 12:22






I presume you should put v-for on v-hover or wrap list inside the v-hover.
– Traxo
Nov 8 at 12:22






1




1




@BillalBegueradj It seemed weird but I asked whether they all should share the same class
– barbsan
Nov 8 at 12:59






@BillalBegueradj It seemed weird but I asked whether they all should share the same class
– barbsan
Nov 8 at 12:59














1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Try moving v-for from v-list-tile to v-hover (demo):



<v-list dense>
<v-hover v-for="menuItem in menuItems">
<v-list-tile
:key="menuItem.title"
slot-scope="{ hover }"
:class="`elevation-${hover ? 12 : 0}`">

<!-- your content -->

</v-list-tile>
</v-hover>
</v-list>





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206874%2fambiguous-combined-usage-of-slot-scope-and-v-for-on-v-for-takes-higher-priority%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    Try moving v-for from v-list-tile to v-hover (demo):



    <v-list dense>
    <v-hover v-for="menuItem in menuItems">
    <v-list-tile
    :key="menuItem.title"
    slot-scope="{ hover }"
    :class="`elevation-${hover ? 12 : 0}`">

    <!-- your content -->

    </v-list-tile>
    </v-hover>
    </v-list>





    share|improve this answer



























      up vote
      1
      down vote



      accepted










      Try moving v-for from v-list-tile to v-hover (demo):



      <v-list dense>
      <v-hover v-for="menuItem in menuItems">
      <v-list-tile
      :key="menuItem.title"
      slot-scope="{ hover }"
      :class="`elevation-${hover ? 12 : 0}`">

      <!-- your content -->

      </v-list-tile>
      </v-hover>
      </v-list>





      share|improve this answer

























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        Try moving v-for from v-list-tile to v-hover (demo):



        <v-list dense>
        <v-hover v-for="menuItem in menuItems">
        <v-list-tile
        :key="menuItem.title"
        slot-scope="{ hover }"
        :class="`elevation-${hover ? 12 : 0}`">

        <!-- your content -->

        </v-list-tile>
        </v-hover>
        </v-list>





        share|improve this answer














        Try moving v-for from v-list-tile to v-hover (demo):



        <v-list dense>
        <v-hover v-for="menuItem in menuItems">
        <v-list-tile
        :key="menuItem.title"
        slot-scope="{ hover }"
        :class="`elevation-${hover ? 12 : 0}`">

        <!-- your content -->

        </v-list-tile>
        </v-hover>
        </v-list>






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 8 at 13:22

























        answered Nov 8 at 13:13









        barbsan

        2,106521




        2,106521






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206874%2fambiguous-combined-usage-of-slot-scope-and-v-for-on-v-for-takes-higher-priority%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Schultheiß

            Verwaltungsgliederung Dänemarks

            Liste der Kulturdenkmale in Wilsdruff