Вот пример CodeSandbox .
Вы можете изменить отображаемый виджет (re: component), установив интервал и привязку динамические компоненты .
<template>
<component :is="active"></component>
</template>
<script>
import ComponentA from "./components/ComponentA";
import ComponentB from "./components/ComponentB";
import ComponentC from "./components/ComponentC";
export default {
name: "App",
components: {
ComponentA,
ComponentB,
ComponentC
},
data () {
return {
rate: 5,
active: 'component-a',
interval: null,
components: ['component-a', 'component-b', 'component-c']
}
},
mounted () {
this.interval = setInterval(this.rotate.bind(this), this.rate)
},
methods: {
rotate () {
const index = this.components.findIndex(component => component === this.active)
this.active = ((index + 1) === this.components.length) ? this.components[0] : this.components[index + 1]
}
}
</script>