set slider value


Topic: set slider value

ozgehan pro premium asked 5 years ago

Hi,

I want to set slider value on script part but for some reason I cannot set value of the slider. I can do at first initialization of slider but after that I cannot change value.

I couldn't create snippet for it because I think something wrong with vue snippets because it gives "Internal Server Error" for all vue snippets such as https://mdbootstrap.com/snippets/vue/ascensus/508896

   <mdb-range-input :min="0" :max="100" :value="opVal"></mdb-range-input>
    export default {
  name: "sidebarComp",
         data() {
            return {
              opVal:0
            };},
      methods: {
        someEvent() {
    this.opVal=100;
}
}

Magdalena Dembna staff premium answered 5 years ago

We had a problem with our snippets but it should be fixed by now. I can see the problem - component's value does update correctly but doesn't trigger rerender. I am adding the task to fix this problem. You can use a small hack if you don't want to wait until we fix the bug in our package - if you add a key property and bind it to the same value it will trigger an update every time the value changes:

   <mdb-range-input :key="opVal" :min="0" :max="100" v-model="opVal"></mdb-range-input>

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB Vue
  • MDB Version: 6.0.0
  • Device: computer
  • Browser: chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: Yes