How do you use extension operators to transfer attributes like react in vue?

in react, if the third-party components are encapsulated, then {a, b, .props} = this.props; < Button {.props} / > an and b are custom attributes, and the remaining attributes are passed directly to the third-party components. How to achieve this function in vue?


v-bind

https://cn.vuejs.org/v2/api/-sharp.

<example v-bind="{a, b, ...props}"></example>
...
data() {
    return {
        a: xx,
        b: xx,
        props: { ... }
    }
}

however, if you want to get an and b in example, you still have to define them in props.


try using the render function

Menu