I'm not sure what your Vue
object looks like, but this is working for me..
Edit #2: it looks like this is 'common'.. Also, you need to make sure you have all of the correct css
files loaded, etc.. It would be extremely helpful if you could provide some code that reproduces this issue, or elaborate more on your config.. Are you doing anything special with css
, etc..?
Edit #2.1: you could try either of the following examples, based upon their documentation and the layout-on
property.. (this is a stab in the dark - I'm not sure if either of these examples will work..)
// Example 1:
<mdc-slider
v-model="value"
min=0
max=120
step=5
layout-on // ADDED: you could try using an empty prop
unit="mins" // not sure what this is doing?
/>
// Example 2:
<mdc-slider
v-model="value"
min=0
max=120
step=5
layout-on="change" // ADDED: or pass in the 'change' event
unit="mins" // not sure what this is doing?
/>
From the documentation:
(*) By default, the slider component tracks window resize and drawer open/close events in order to reset it's layout, but it in case off css resize or positioning change, the layout may be off. in this case you can use the layout-on event to force a layout, or call the layout() method programatically.
CodePen mirror
Edit: I bet it's because you are passing in String
's and not Number
's in the max
, min
, and step
, properties.. You can read more in their documentation here. Or you may not have the proper css
loaded?
Try something like this:
<mdc-slider
v-model="value"
min=0 // or :min="0"
max=120 // or :max="120"
step=5 // or :step="5"
unit="mins"
/>

new Vue({
el: "#app",
data: {
max1: 120,
max2: 200,
value1: 120,
value2: 80,
}
})
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" type="text/css">
<link rel="stylesheet" href="https://unpkg.com/vue-mdc-adapter@^0.6.0/dist/vue-mdc-adapter.min.css" type="text/css">
<script src="https://unpkg.com/vue@^2.5.9/dist/vue.min.js"></script>
<script src="https://unpkg.com/vue-mdc-adapter@^0.6.0/dist/vue-mdc-adapter.min.js"></script>
<div id="app">
<div>
<div style="width: 400px; margin: 50px 0 0 30px;">
<span>Max: <b>{{ max1 }}</b> | Current: <b>{{ value1 }}</b></span>
<mdc-slider min=0 :max=max1 step=10 display-markers v-model="value1" />
</div>
<div style="width: 400px; margin: 50px 0 0 30px;">
<span>Max: <b>{{ max2 }}</b> | Current: <b>{{ value2 }}</b></span>
<mdc-slider min=0 :max=max2 step=10 display-markers v-model="value2" />
</div>
</div>
</div>