I want v-model="num" just when the v-if prop === 'amount'. How can i do it? because the input is common to 'qty' and 'book_value'
<template #item="{ prop, value, rowIndex }">
<div
v-if="prop === 'qty' || prop === 'book_value'"
>
<input
v-model="num"
:value="preview && prop === 'book_value'? formatAmount(value) : value"
:preview="preview"
@input="setRuleItem({ newValue: $event, prop, rowIndex, name: 'actions' })"
/>
---------------------------
watch: {
num (newVal, oldVal) {
if (newVal.includes('.')) {
this.$nextTick(() => { this.num = newVal.split('.')[0] + '.' + newVal.split('.')[1].slice(0, 2) })
}
}
},