How to use VUE to implement deletion and undelete functions?
<p id="one">
<p>
<span>1</span>
<span>这是一条信息</span>
<span style="color: red">删除</span>
</p>
<p>
<span>2</span>
<span>这是一条信息</span>
<span style="color: red">删除</span>
</p>
</p>
<p id="two">
<p>
<span>2</span>
<span>这是一条信息</span>
<span style="color: green">撤销删除</span>
</p>
</p>
Finally, by clicking the button, you can get the deleted information and the information that has not been deleted.
When generating information, add the ID and use the ID to obtain the corresponding information
When deleting, push the value to be deleted to an array delList
When undoing, pop out the last deleted value