vue get attribute value

如下:

attribute为"store-qty",其值为"4523"。

vue语法,event.target.getAttribute('store-qty'),可获取其值。

Vue.config.productionTip = false;
        Vue.config.devtools = false;

        var vue_select = new Vue({
            el: '#test',
            data: {
                welcome: "Hello, Insus.NET."
            },           
            methods: {
                getAttrVal(event) {
                    var attrVal = event.target.getAttribute('store-qty');
                    alert(attrVal);
                }
            }
        })
Javascript Source Code
原文地址:https://www.cnblogs.com/insus/p/13419628.html