美文网首页
vue动态绑定属性/事件

vue动态绑定属性/事件

作者: jack_rofer | 来源:发表于2020-11-24 18:16 被阅读0次

    1.动态绑定属性/事件

    <span :[someAttr]='attrValue' @[event]="handelClick">
    
    data(){
      someAttr: 'hidden', //https://developer.mozilla.org/zh-CN/docs/web/html/attributes
      attrValue: 'text',
      event: 'click'  // https://developer.mozilla.org/zh-CN/docs/Web/Events
    },
    methods: {
       handelClick(){
       ///
      }
    }
    

    相关文章

      网友评论

          本文标题:vue动态绑定属性/事件

          本文链接:https://www.haomeiwen.com/subject/nmcwiktx.html