vue-custom-form/public/components/range.js
Andrew Gundersen 05ee1e7350 adding comments
2023-08-03 03:08:58 -04:00

46 lines
No EOL
461 B
JavaScript

const Range =
{
props: ["field"],
components: {
},
setup(props)
{
const ref = Vue.ref(50);
Vue.watch(ref, (c, _p) => {
props.field.value = parseInt(c);
});
return { ref };
},
template: `
<div class="range">
<div>{{ ref }}</div>
<input
v-model="ref"
type="range"
min="0"
max="100"
value="50"
step="1"
>
</div>
`
}
export default Range
/*
Update the results live with the sliding action.
*/