Vue-slider-component: Multiple Piecewise from Slots

Created on 21 Dec 2017  路  4Comments  路  Source: NightCatSama/vue-slider-component

Hi. I麓m trying to add some piecewises into my slider only on specific indexes but only the last one added is currently showed.

There's any way I could archieve that?

My current code for showind the piecewises is:

<template slot="piecewise" slot-scope="{ label, active, index }"> <div v-if="index === 10" class="my-piecewise" :data-value="label"></div> </template>

<template slot="piecewise" slot-scope="{ label, active, index }"> <div v-if="index === 20" class="my-piecewise" :data-value="label"></div> </template>

Thanks.

Most helpful comment

@alexpvieira use only one named slot, i.e. put 2 or more divs inside a single named slot

Fiddle: https://jsfiddle.net/ktqfaozn/2/

All 4 comments

My test is normal: https://jsfiddle.net/2xy72dod/318/

Can you repeat the problem?

I've used your exemple and only one piecewise is showed (the last one).

https://jsfiddle.net/ktqfaozn/

I need to set three different ones into the same slider.

@alexpvieira use only one named slot, i.e. put 2 or more divs inside a single named slot

Fiddle: https://jsfiddle.net/ktqfaozn/2/

@birdspider thank you! It worked.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ThomasPoncet picture ThomasPoncet  路  5Comments

senner007 picture senner007  路  5Comments

joshua-larks picture joshua-larks  路  5Comments

Rrrafau picture Rrrafau  路  4Comments

mayajuni picture mayajuni  路  3Comments