Vue.js
- 19 ответов
- 0 вопросов
6
Вклад в тег
<component :is="currentComponent" />
<button @click="currentComponent = ComponentTwo">Switch to component2</button
<button @click="currentComponent = ComponentThree">Switch to component3</button
import ComponentOne from '...'
import ComponentTwo from '...'
import ComponentThree from '...'
const currentComponent = shallowRef(ComponentOne)
const table_headers = ref([
{name: "family_name", label: "Фамилия", widget_type: 'TextWidget', component: ComponentOne},
{name: "given_name", label: "Имя", widget_type: 'TextWidget', component: ComponentTwo},
{name: "date_of_birth", label: "Дата рождения", widget_type: 'TextWidget', component: ComponentThree},
])
<component
:is="col.component"
:widget_name="[[col.name]]"
:widget_label="[[col.label]]"
></component>