javascript - How to add click event to option in vuejs
高洛峰
高洛峰 2017-06-27 09:19:40
0
3
1050

The added click event is not called

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(3)
学习ing
<select @change="test">
      <option>l</option>
      <option>m</option>
      <option>z</option>
      <option>zs</option>
    </select>

Is that so?

typecho

The click event is written in <select>

Ty80

A terrible thing happened. You actually have the same way of writing as me. My last problem was that there were two exactly the same options, and one was usable and the other was not. So it is not recommended that you use this method.

  1. Use watch to monitor your value. If it changes, call the event to be data-driven.

  2. @change="" is also possible, but there are definitely limitations.

  3. Same as method 1, except that in other places where you use this value, you also use the variables tied to your v-model to be data-driven, but it also has limitations and it is impossible to use it in all scenarios

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template