0
点赞
收藏
分享

微信扫一扫

vue3官方文档(4)通过v-bind绑定多个值


给v-bind属性指定一个对象的名字

<script>
export default {
  data() {
    return {
      css: {class:'wrapper',id:'div1'}
      
    }
  }
}
</script>

<template>
<div v-bind="css">this is a div</div>
</template>

<style scoped>
button {
  font-weight: bold;
}

.wrapper {
    background-color: rgb(64, 255, 0);
}
</style>


举报

相关推荐

0 条评论