javascript - avalon.js ms-on event binding is invalid?
typecho
typecho 2017-07-05 10:42:46
0
1
923

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?

typecho
typecho

Following the voice in heart.

reply all(1)
phpcn_u1582

Because the triggering conditions of ms-on-change are similar to the onchange triggering conditions of select, both are triggered when the value changes.

In your example, there is only one option under select, so even if you click, it will not change the value of select, so ms-on-change will not be triggered.

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