我目前正在与Laravel和Vue / Vuetify一起使用图像轮播,并且我正在使用Vuetify v-carousel和v-carousel-item来实现此目的,但由于存在错误,因此轮播无法渲染标题。
我已经根据vuetify文档正确初始化了Vuetify实例
-以下代码适用于我的app.js-
import Vue from 'vue'
import Vuetify, {VCarousel} from 'vuetify/lib'
Vue.component('example-component', require('./components/ExampleComponent.vue').default);
Vue.use(Vuetify, {
components: {
VCarousel,
},
})
// export default new Vuetify({})
const app = new Vue({
}).$mount('#app');
-以下代码适用于使用轮播的组件-
<template>
<v-carousel>
<v-carousel-item v-for="(slide, i) in slides" :src = "slide.content " :key=i>
</v-carousel-item>
<v-carousel-item>
<!-- <v-playback autoPlay :url = "video" :type="video/mp4" :width = "720" @play = "pauseCarousel" @pause = "playCarousel" ref = 'videoPlayer'></v-playback> -->
</v-carousel-item>
</v-carousel>
</template>
这给了我这个错误
[Vue warn]: Error in render: "TypeError: Cannot read property 't' of undefined"
found in
---> <VCarousel>
<ImageCarousel> at resources/js/components/ImageCarousel.vue
<ExampleComponent> at resources/js/components/ExampleComponent.vue
<Root>