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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM