For example, when I use react, the dynamic attributes of the operation of dom:
// The "options" is a object.
<div {... options} />
So I realized the production of the object through the front of the object to achieve the dynamic operation of the div, because I can not determine the property has a fixed set, can only use the program production, react also take this into account so that they describe the render also directly , The direct use of ES6 attribute expansion (... operator) can achieve results.
However, in the vue-template, try the ES6 deconstruction (... operator) also read the entire vue official documents, are to find relevant instructions and documentation.
Just as react as simple as providing a parameter argument, setting a dynamic property, or providing something like react, directly supporting the use of ES6's ... object structure.
举个例子,我在使用 react 的时候,对 dom 进行动态属性的操作:
// The 「options」 is a object.
<div {...options} />
这样我就实现了 通过前面生产 options 这个对象达到对 div 的动态属性操作,因为我无法确定拥有固定的属性设置,只能运用程序生产,react 也考虑到了这一点 所以 react 他们描述 render 中也直接说,直接运用 ES6 的属性展开(... 操作符)就可以达到效果。
但是在 vue-template 中,尝试了 ES6 的解构符(... 操作符)也完整的翻阅了整个 vue 官方文档,均为找到相关说明和文档。
就像 react 那么简单,提供一个参数参数,设置动态属性,或者提供 类似 react 那种,直接支持使用 ES6 的 ... object 结构符。
v-bind="object"
@yyx990803 Thanks, It is recommended to join vue official documents, thanks again.
Most helpful comment
v-bind="object"