new Vue({ el: '#cards', data: { currentCardId: '1', cards: [ { id: '1', name: 'Link A', link: '#a' }, { id: '2', name: 'Link B', link: '#a' }, { id: '3', name: 'Link C', link: '#c' }, ] }, computed: { currentCardComponent: function () { return 'card' + this.currentCardId.toLowerCase(); } }, events: { changeCard: function (cardId) { this.currentCardId = cardId }, }, });
Обсуждают сегодня