Skip to content

Commit 6f5b71d

Browse files
author
Lionel Bijaoui
committed
creation of two computed value to avoid a warning from Vue in noUiSlider field
1 parent deb50b6 commit 6f5b71d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/fields/fieldNoUiSlider.vue

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="slider" :disabled="disabled" :class="{ 'contain-pips': typeof schema.noUiSliderOptions.pips !== 'undefined', 'contain-tooltip': schema.noUiSliderOptions.tooltips }"></div>
2+
<div class="slider" :disabled="disabled" :class="{ 'contain-pips': containPips, 'contain-tooltip': containTooltip }"></div>
33
</template>
44

55
<script>
@@ -23,6 +23,15 @@
2323
}
2424
},
2525
26+
computed:{
27+
containPips(){
28+
return (this.schema.noUiSliderOptions && (typeof this.schema.noUiSliderOptions.pips) !== "undefined");
29+
},
30+
containTooltip(){
31+
return (this.schema.noUiSliderOptions && this.schema.noUiSliderOptions.tooltips);
32+
}
33+
},
34+
2635
methods: {
2736
onChange(value) {
2837
if (isArray(value)) {

0 commit comments

Comments
 (0)