vue 幻灯片组件

Vue-tantan堆栈 (vue-tantan-stack)

A nice slide Component with vue.js.

带有vue.js的漂亮幻灯片组件。

View demo 查看演示 Download Source 下载源

安装 (install)

npm install vue-tantan-stack --save

用 (use)

<template><div class="mid-center"><div class="stack-wrapper"><stack ref="stack" :pages="someList" :stackinit="stackinit"></stack></div><div class="controls"><button @click="prev" class="button"><i class="prev"></i><span class="text-hidden">prev</span></button><button @click="next" class="button"><i class="next"></i><span class="text-hidden">next</span></button></div></div>
</template>
<script>
import stack from '../components/stack'
export default {el: '#stack',data () {return {someList: [],stackinit: {visible: 3}}},mounted () {let that = thissetTimeout(function () {that.someList = [{html: '<img src="src/img/1.png" alt="01">'},{html: '<img src="src/img/2.png" alt="02">'},{html: '<img src="src/img/3.png" alt="03">'},{html: '<img src="src/img/4.png" alt="04">'},{html: '<img src="src/img/5.png" alt="05">'},{html: '<img src="src/img/6.png" alt="06">'},{html: '<img src="src/img/7.png" alt="07">'}]}, 2000)},components: {stack},methods: {prev () {this.$refs.stack.$emit('prev')},next () {this.$refs.stack.$emit('next')}}
}
</script>
<style>.stack-wrapper{margin: 0 auto;position: relative;z-index: 1000;width: 320px;height: 320px;padding: 0;list-style: none;pointer-events: none;}.controls{position: relative;width: 200px;text-align: center;display:flex;/*Flex布局*/display: -webkit-flex; /* Safari */justify-content:space-around;margin: 0 auto;margin-top: 50px}.controls .button {border: none;background: none;position: relative;display: inline-block;cursor: pointer;font-size: 16px;width: 50px;height: 50px;z-index: 100;-webkit-tap-highlight-color: rgba(0,0,0,0);border-radius: 50%;background: #fff;}.button .next{display: inline-block;width: 10px;height:5px;background: rgb(129,212,125);line-height: 0;font-size:0;vertical-align: middle;-webkit-transform: rotate(45deg);left: -5px;top: 2px;position: relative;}.button .next:after{content:'/';display:block;width: 20px;height:5px;background: rgb(129,212,125);-webkit-transform: rotate(-90deg) translateY(-50%) translateX(50%);}.button .prev{display: inline-block;width: 20px;height:5px;background: rgb(230,104,104);line-height: 0;font-size:0;vertical-align: middle;-webkit-transform: rotate(45deg);}.button .prev:after{content:'/';display:block;width: 20px;height:5px;background: rgb(230,104,104);-webkit-transform: rotate(-90deg);}.controls .text-hidden {position: absolute;overflow: hidden;width: 0;height: 0;color: transparent;display: block;
}
</style>

翻译自: https://vuejsexamples.com/a-nice-slide-component-with-vue/

vue 幻灯片组件

vue 幻灯片组件_带有vue的漂亮幻灯片组件相关推荐

  1. vue 单一页面_带有vue的单一Flash消息

    vue 单一页面 Vue Flash消息 (vue-flash-message) The component to display single flash message to user. It h ...

  2. vue日期选择组件_一个Vue组件,为波斯开发人员提供日期选择器

    vue日期选择组件 Vue波斯日期选择器 (vue persian datepicker) This is a Jalali date picker component for Vue. 这是Vue的 ...

  3. 动态添加组件_使用vue.js的动态组件模板

    最近刚做完建站工具,准备总结里面使用到的一些技巧,同时会做一版简化的放在 github上. 先来一篇翻译的文章,和我在项目中使用的动态组件思路一样,不过缺少了演化的过程,直接给出了最终的解决方案.这篇 ...

  4. vue tree组件_使用Vue 3.0做JSX(TSX)风格的组件开发

    前言 我日常工作都是使用React来做开发,但是我对React一直不是很满意,特别是在推出React Hooks以后. 不可否认React Hooks极大地方便了开发者,但是它又有非常多反直觉的地方, ...

  5. picker插件 vue 移动端_基于 vue 的 picker 组件 vue-awesome-picker

    ⚠️ DEPRECATED 本组件停止维护 ⚠️Vue 组件库请移步 Vant ⚠️有赞前端大量坑位,内推私信 vue-awesome-picker Features 支持单列.多列和联级数据 内置时 ...

  6. vue 添加全局组件_自定义vue全局组件(Loading为例)

    首先创建一个项目 vue init webpack-simple define-demo //define-demo 项目名称 cd define-demo npm install //安装本次所有需 ...

  7. axios vue 回调函数_前端Vue 面试题大全

    点蓝色字关注"程序员报刊" 「  学习 新闻 招聘 」 vue的底层原理? vue组件之间的通信? JS中判断数据类型的方法有几种? 最常见的判断方法:typeof 判断已知对象类 ...

  8. 覆盖vue.js样式_使用Vue.js和Cloudinary在化身上覆盖眼镜/面罩

    覆盖vue.js样式 Deep Learning, a subset of machine learning, helps break down tasks in ways that makes al ...

  9. vue 路由重定向_使用Vue和Vue路由器进行高级路由:重定向和Nav Guard

    vue 路由重定向 While the basics of routing in Vue.js have already been covered, today we'll explore some ...

最新文章

  1. keras Classifier 分类
  2. HMM -GMM 理清不错
  3. Shell中read的常用方式
  4. 第十二届蓝桥杯省赛第二场C++B组真题 【未完结】
  5. how can you understand the world
  6. PHP面向对象 封装与继承
  7. nodejs 获取cpu核心数量_用 NodeJS 充分利用多核 CPU 的资源[每日前端夜话0xCB]
  8. pyqt5 下拉 多页 点击_PyQt5实战——自定义翻页控件实现
  9. 现在最流行哪款有linux系统,哪一个Linux发行版最流行?
  10. The stacking context
  11. 【概率论与数理统计】小结7 - 统计学中的基本概念
  12. 基于高德地图的城市区域代码表
  13. 游戏毕业设计参考文献合集
  14. 软件测试实例:登录功能怎么设计测试用例
  15. 一文说清长安链ChainMaker同步模块
  16. 用Python进行web开发需要学习什么?
  17. 天的各种书法_你可知道书法里的各种关系?
  18. 字符串操作函数的实现【详解】
  19. 解决开机提示High Severity Error问题
  20. Bugzilla的bug状态

热门文章

  1. 超声图像和乳房X光筛查的区别
  2. mpvue小程序踩坑
  3. COCI2014silueta
  4. Java进制转换原理详解
  5. OpenProcessToken令牌函数使用方法
  6. python问题随手记录20210313
  7. 【机器视觉3】双目立体视觉模型
  8. C++(一)——HelloWorld
  9. 【转载】一个人成败的关键:先有系统思维,然后才有看穿本质的能力
  10. 机器学习 - 编程练习(一):线性回归