vue和element ui 下拉框select的change事件

匿名 (未验证) 提交于 2019-12-03 00:30:01

1 在线编辑测试工具

https://jsfiddle.net/api/post/library/pure/

编辑好代码后点击 run 即可



2.1 html部分

https://jsfiddle.net/znebqjvL/1/?utm_source=website&utm_medium=embed&utm_campaign=znebqjvL

  1. <divid="app">
  2. <buttontype="button"class=click="add">新增</button>
  3. <tableclass=>
  4. <thead>
  5. <tr>
  6. <thwidth="100px"></th><th></th><th></th>
  7. <th></th><th></th><th></th>
  8. <th></th><th></th>
  9. </tr>
  10. </thead>
  11. <tbody>
  12. <trv-for=>
  13. <td>
  14. <selectv-model="selected"class="form-control"change=>
  15. <optionvalue=""></option>
  16. <option:value="drug"v-for=></option>
  17. </select>
  18. </td>
  19. <td><inputtype="text"class="form-control"placeholder="use"v-model="item.use"></td>
  20. <td><inputtype="text"class="form-control"placeholder="unit":value="getDrug(item.drug_id).unit"></td>
  21. <td><inputtype="text"class="form-control"placeholder="rate"v-model="item.rate"></td>
  22. <td><inputtype="text"class="form-control"placeholder="amount":value="item.amount"input=></td>
  23. <td><inputtype="text"class="form-control"placeholder="price":value="getDrug(item.drug_id).price"></td>
  24. <td><inputtype="text"class="form-control"placeholder="money":value="item.money"></td>
  25. <td><buttontype="button"class=click="remove(itemIndex)">删除</button></td>
  26. </tr>
  27. <trv-if="!items.length">
  28. <tdcolspan="8"class="empty">尚未新增任何资料</td>
  29. </tr>
  30. <tr>
  31. <tdcolspan="8"class="right"></td>
  32. </tr>
  33. </tbody>
  34. </table>
  35. <hr>
  36. <p>
  37. <pre>
  38. </pre>
  39. </p>
  40. </div>


2.2 js部分

  1. d>d.id
  2. drugthis
  3. money
  4. item.moneyisNaN
  5. this.totalMoneyparseFloati>>
  6. item.drug_idparseInt
  7. amountparseFloat
  8. item.amount
  9. item.amountamount
  10. item.amount0

2.3 css部分

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!