Vuejs2 来自列表或对象的Vue.js属性绑定

Vuejs2 来自列表或对象的Vue.js属性绑定,vuejs2,Vuejs2,我正在试验Vue.js2.3。我习惯于手动绑定属性,例如 Vue.component('my-component', { props: ['info'], computed: { type: function() { return info.type }, classList: function() { return this.info.attributes.classList }, id: function() { return

我正在试验Vue.js2.3。我习惯于手动绑定属性,例如

Vue.component('my-component', {
    props: ['info'],
    computed: {
        type: function() { return info.type },
        classList: function() { return this.info.attributes.classList },
        id: function() { return this.info.attributes.id }
    }
    template: '<component :is="type" :class="classList" :id="id">{{ info.text }}</component>'
})
这将产生以下结果:

<h2 class="a string" id="another-string">Some text</h2> 
如何绑定所有这些属性而不必列出可能出现的所有属性?

接受对象作为参数,并将所有属性绑定到它们的值

template: '<component :is="type" v-bind="info.attributes"></component>'
接受对象作为其参数,并将所有属性绑定到其值

template: '<component :is="type" v-bind="info.attributes"></component>'

我应该补充的是,我可以将attributes属性修改为列表或对象,只要更简单。例如,attributes:[{key:id,value:a-string},…]我应该添加我可以将attributes属性修改为列表或对象,只要更简单。例如属性:[{key:id,value:a-string},…]我怎么会错过这个?非常感谢,正如你所期待的那样。我怎么会错过呢?非常感谢,一切如你所愿。
template: '<component :is="type" v-bind="info.attributes"></component>'