为什么我引入swiper并且写上代码之后一直报这个错误。

来源:2-5 【讨论题】你所知道的常用设计模式有哪些?

qq_火妍_0

2021-05-15

为什么我引入swiper并且写上代码之后一直报这个错误。
vue.esm.js?efeb:4493 Uncaught RangeError: Maximum call stack size exceeded
at normalizeScopedSlots (vue.esm.js?efeb:2591)
at VueComponent.Vue._render (vue.esm.js?efeb:3540)
at VueComponent.updateComponent (vue.esm.js?efeb:4075)
at Watcher.get (vue.esm.js?efeb:4488)
at new Watcher (vue.esm.js?efeb:4477)
at mountComponent (vue.esm.js?efeb:4082)
at VueComponent.Vue.mount(vue.esm.js?efeb:9063)atVueComponent.Vue.mount (vue.esm.js?efeb:9063) at VueComponent.Vue.mount(vue.esm.js?efeb:9063)atVueComponent.Vue.mount (vue.esm.js?efeb:11974)
at init (vue.esm.js?efeb:3127)
at createComponent (vue.esm.js?efeb:5989)

写回答

2回答

qq_火妍_0

提问者

2021-05-16

package.json里的

"vue-awesome-swiper": "^3.1.3",

swiper这个组件里的代码:

<template>

  <div class="wrapper">

     <swiper :options="swiperOption" ref="mySwiper">

      <swiper-slide>I'm Slide 1</swiper-slide>

      <swiper-slide>I'm Slide 2</swiper-slide>

      <swiper-slide>I'm Slide 3</swiper-slide>

      <div class="swiper-pagination" slot="pagination"></div>

      <div class="swiper-button-prev" slot="button-prev"></div>

      <div class="swiper-button-next" slot="button-next"></div>

    </swiper>

  </div>

</template>


<script>

import { swiper, swiperSlide } from "vue-awesome-swiper";

import "swiper/dist/css/swiper.css";

export default {

  name:'swiper',

  components: {

    swiper,

    swiperSlide

  },

   data() {

    return {

      swiperOption: {

        loop: true,

        autoplay: {

          delay: 3000,

          stopOnLastSlide: false,

          disableOnInteraction: false

        },

        // 显示分页

        pagination: {

          el: ".swiper-pagination",

          clickable: true //允许分页点击跳转

        },

        // 设置点击箭头

        navigation: {

          nextEl: ".swiper-button-next",

          prevEl: ".swiper-button-prev"

        }

      }

    };

  },


0
0

Dell

2021-05-16

死循环了,你代码发上来看一下吧

0
2
Dell
回复
qq_火妍_0
export default { name:'swiper', 换个名字
2021-05-19
共2条回复

Vue2.5-2.6-3.0开发去哪儿网App 零基础入门到实战

课程紧跟Vue3版本迭代,企业主流版本Vue2+Vue3全掌握

10675 学习 · 8191 问题

查看课程