zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    @雅礼集训01/13
    @hdu
    @bzoj
    @hdu
    @bzoj
    @雅礼集训01/10
    @codeforces
    @spoj
    @bzoj
    @bzoj
  • 原文地址:https://www.cnblogs.com/insus/p/13419628.html
Copyright © 2011-2022 走看看