vue-swiper icon indicating copy to clipboard operation
vue-swiper copied to clipboard

如何在单独的vue视图中使用这个组件

Open madneal opened this issue 7 years ago • 2 comments

由于接触vue不久,想在vue单独文件中做一个轮播视图,但是总报错vue.esm.js?7a34:434 [Vue warn]: Failed to resolve directive: el, 而且这个轮播图的确是不能滑动的,单独的vue组件代码如下:

<template>
  <div class="home">
    <swiper :pagination-visible="true" direction="horizontal">
        <div><img src="../assets/pagebg1.jpg"></div>
        <div><img src="../assets/pagebg2.jpg"></div>
        <div><img src="../assets/pagebg3.jpg"></div>
    </swiper>
  </div>
</template>

<script>
import Swiper from 'vue-swiper'

export default {
  name: 'Home',
  components: {
    Swiper
  }
}
</script>

<style>
.home img {
  height: 32rem;
  width: 90%;
}
</style>

如果可以的话,希望帮我解惑一下,我不知道在这个vue文件中应该如何初始化el

madneal avatar Jul 10 '17 12:07 madneal

@neal1991 请问这个问题解决了吗 我也刚接触vue 遇到同样的问题

oo6890049 avatar Jul 21 '17 06:07 oo6890049

Что за буквы вы используете? Ничего не могу прочитать...

romash1408 avatar Dec 08 '18 21:12 romash1408