select binding event
<select class="form-control box-shadow-none select-device-type" name="macAddress" ms-on-change="selectChange()">
<option value="11">111</option>
</select>
var vm = avalon.define({
$id: "checkDeviceContext",
deviceList: [],
selectChange: function () {
alert(1)
}
});
If you change change to click, there will be no problem. What is the reason?
Because the triggering conditions of
ms-on-change
are similar to theonchange
triggering conditions ofselect
, both are triggered when the value changes.In your example, there is only one
option
underselect
, so even if you click, it will not change the value ofselect
, soms-on-change
will not be triggered.