Vue 绑定多个参数

Vue About 297 words

v-bind

多个参数组成的对象objectOfAttrs

data() {
  return {
    objectOfAttrs: {
      id: 'container',
      class: 'wrapper'
    }
  }
}

v-bind不加任何参数,表示将这个多参数对象绑定到div上。

<div v-bind="objectOfAttrs"></div>

参考

https://staging-cn.vuejs.org/guide/essentials/template-syntax.html#attribute-bindings

Views: 623 · Posted: 2023-01-10

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh