0π
β
I believe the issue youβre seeing is due to the way type coercion works in js
if you have a if(val == false)
or just if(val)
it will change the type of the variable, and because "" == false
, this statement will be treated as falsy if the value is an empty string: v-if="editableData[record.key + '|' + column.key]"
Because your delete command in the save method will remove the key value, you can do a type-strict compare against undefined
like this:
<div
v-if="editableData[record.key + '|' + column.key] !== undefined"
class="editable-cell-input-wrapper"
>
Source:stackexchange.com