vue.js - vuejs dynamic input collection with wrong values
问题描述
I am dynamically adding inputs of type text to a vuex collection. It adds the input at specific index. It works good, no problem with that. The issue happens when I write some value in the input and then try to add a new one. The input value jumps to the newly added input. Here is a simple code example: https://codesandbox.io/s/0yrzrw6120
Steps to reproduce:
There is a default input. You can add inputs below that, so:
- Add a new input.
- Write some value in the newly added input.
- Add a new input again from the default button.
What I am expecting is a new input below default with no value in it, and it works but the value of the last input jumps to the newly added.
I understand is not a problem with the additions of items but the value in the inputs.
解决方案
推荐阅读
- boost - Boost:如何构建特定的数学工具目标?
- selenium - 如何转换为c#
- r - ggplot2:使用 geom_point() 并不是我所有的字符标签都绘制在 X 轴上
- r - 如何在同一网格中为两个 geom_step 函数插入颜色代码
- javascript - 如何一起运行 reactjs 应用程序和 golang 后端?
- android - 强制应用在 Android 的新任务中启动
- typescript - VSCode 菜单中缺少“转到定义”
- sql-server - 找不到 SQL Server Installation Center 2017 exe 文件时如何添加本地实例服务器?
- python - Django在数据库中没有具有相同用户名的用户
- ios - 崩溃 -[CTTelephonyNetworkInfo updateRat:descriptor:]