Skip to content
This repository has been archived by the owner on Jun 10, 2023. It is now read-only.

MDL Slider - valueNumber missing setter #285

Open
ntoljic opened this issue Jul 28, 2018 · 0 comments
Open

MDL Slider - valueNumber missing setter #285

ntoljic opened this issue Jul 28, 2018 · 0 comments

Comments

@ntoljic
Copy link

ntoljic commented Jul 28, 2018

When I add a slider to my Vue component as shown in the docs I get the following
warning:

Computed property "valueNumber" was assigned to but it has no setter.

Sample component:

<template lang="pug">
    mdl-slider(v-model="amount" min="0" max="100")
</template>

<script lang="ts">
import {Component, Vue} from 'vue-property-decorator';

@Component
export default class SliderComponent extends Vue {
  private amount: number = 5;
}
</script>

A quick look into slider.vue shows that valueNumber indeed only has a getter defined like so:

valueNumber () {
  return Number(this.value)
},

From a quick google search it is my understanding that if a computed property is used with v-model, as is the case with valueNumber, it must have a corresponding setter.

Therefore my suggested fix is to simply add a setter for valueNumber.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant