[Vuejs]-Input closes when I try to delete the string and the string has the length 1 on Ant Design Vue Table

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"
>

Leave a comment