Есть код:
На странице:
<component :is="currentTabComponent" v-bind="currentProperties"></component>
И в app.js:
computed: {
currentTabComponent: function () {
return this.presentComponent;
},
currentProperties: function() {
if (this.currentTabComponent == 'count-down') {
var presentTime = new Date(Date.now() + 15 * 60 * 1000);
return { date: presentTime }
}
if (this.currentTabComponent == 'introduction') {
return { course_image: "asset('images/courses/169ed27b759041a0106b9468362f4777.jpeg')" }
}
if (this.currentTabComponent == 'exam-question') {
return { question: '@json($question)' }
}
}
}
Хочу сделать аналог SPA в пределах одной страницы.
До этого были такие props: :course_image = "asset('images/courses/169ed27b759041a0106b9468362f4777.jpeg'
и :question: '@json($question)'
.
Как сделать привязку, чтобы все отрабатывало и правильно передавалось в компоненты?