[Vuejs]-Vue component's (select) on-change function not called if value set from external method

3đź‘Ť

âś…

from change | MDN,

change fires for <input>, <select>, and <textarea> elements when an alteration to the element’s value is committed by the user. Unlike the input event, the change event is not necessarily fired for each alteration to an element’s value.

This means that the change event will only be triggered if the value is “changed” by user. Also it won’t fire if the user selects the same value.

You may use “watch” for detecting changes: JSFiddle

👤Tang Yun

Leave a comment