How does vue bind a set of attributes to a tag?

how do you define the following attributes if you want to add the following set of attributes: {colspan:"3",rowspan:"5",width:"56",.,} to the tag of td? Can you bind a set of properties in a way similar to: style binding style? : attr=? Is there such a usage?

May.10,2021

none, write one by one

or use the render function


var obj = {colspan:'3',rowspan:'5',width:'56',...,}

<td {...obj}/>

v-bind can accept an object.

<comp v-bind="{colspan:'3',rowspan:'5',width:'56'}">

the above is equivalent to:

<comp :colspan="3" :rowspan="5" :width="56">
Menu