Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
madneal opened this issue Jul 10, 2017 · 2 comments
Open

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

madneal opened this issue Jul 10, 2017 · 2 comments

Comments

@madneal
Copy link

madneal commented Jul 10, 2017

由于接触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

@oo6890049
Copy link

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

@romash1408
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants