Carousel not initializing due to ReferenceError: onSlideStart is not defined
Carousel not initializing due to ReferenceError: onSlideStart is not defined
我有一个 bootstrap-vue 旋转木马,它不能正常工作。
我有示例轮播代码 from the examples。我已将此脚本包含在 <div>
:
中
<script>
export default {
data () {
return {
slide: 0,
sliding: null
}
},
methods: {
onSlideStart (slide) {
this.sliding = true
},
onSlideEnd (slide) {
this.sliding = false
}
}
}
</script>
但是,我仍然收到此错误:
vue.min.js:6 ReferenceError: onSlideStart is not defined
at Rt.eval (eval at Tn (vue.min.js:6), <anonymous>:2:271)
at Rt.t._render (vue.min.js:6)
at Rt.r (vue.min.js:6)
at Kr.get (vue.min.js:6)
at new Kr (vue.min.js:6)
at vue.min.js:6
at Rt.$mount (vue.min.js:6)
at Rt.$mount (vue.min.js:6)
at Rt.t._init (vue.min.js:6)
at new Rt (vue.min.js:6)
作为一个 vue 菜鸟,我刚刚意识到我可以在运行时使用以下命令来做到这一点
new Vue({el: '#carousel',
data: {
slide: 0,
sliding: null
},
methods: {
onSlideStart: function(slide) {
this.sliding = true
},
onSlideEnd: function(slide) {
this.sliding = false
}
}
})
我有一个 bootstrap-vue 旋转木马,它不能正常工作。
我有示例轮播代码 from the examples。我已将此脚本包含在 <div>
:
<script>
export default {
data () {
return {
slide: 0,
sliding: null
}
},
methods: {
onSlideStart (slide) {
this.sliding = true
},
onSlideEnd (slide) {
this.sliding = false
}
}
}
</script>
但是,我仍然收到此错误:
vue.min.js:6 ReferenceError: onSlideStart is not defined
at Rt.eval (eval at Tn (vue.min.js:6), <anonymous>:2:271)
at Rt.t._render (vue.min.js:6)
at Rt.r (vue.min.js:6)
at Kr.get (vue.min.js:6)
at new Kr (vue.min.js:6)
at vue.min.js:6
at Rt.$mount (vue.min.js:6)
at Rt.$mount (vue.min.js:6)
at Rt.t._init (vue.min.js:6)
at new Rt (vue.min.js:6)
作为一个 vue 菜鸟,我刚刚意识到我可以在运行时使用以下命令来做到这一点
new Vue({el: '#carousel',
data: {
slide: 0,
sliding: null
},
methods: {
onSlideStart: function(slide) {
this.sliding = true
},
onSlideEnd: function(slide) {
this.sliding = false
}
}
})