vue 幻灯片组件_带有vue的漂亮幻灯片组件
vue 幻灯片组件
Vue-tantan堆栈 (vue-tantan-stack)
A nice slide Component with vue.js.
带有vue.js的漂亮幻灯片组件。
安装 (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的漂亮幻灯片组件相关推荐
- vue 单一页面_带有vue的单一Flash消息
vue 单一页面 Vue Flash消息 (vue-flash-message) The component to display single flash message to user. It h ...
- vue日期选择组件_一个Vue组件,为波斯开发人员提供日期选择器
vue日期选择组件 Vue波斯日期选择器 (vue persian datepicker) This is a Jalali date picker component for Vue. 这是Vue的 ...
- 动态添加组件_使用vue.js的动态组件模板
最近刚做完建站工具,准备总结里面使用到的一些技巧,同时会做一版简化的放在 github上. 先来一篇翻译的文章,和我在项目中使用的动态组件思路一样,不过缺少了演化的过程,直接给出了最终的解决方案.这篇 ...
- vue tree组件_使用Vue 3.0做JSX(TSX)风格的组件开发
前言 我日常工作都是使用React来做开发,但是我对React一直不是很满意,特别是在推出React Hooks以后. 不可否认React Hooks极大地方便了开发者,但是它又有非常多反直觉的地方, ...
- picker插件 vue 移动端_基于 vue 的 picker 组件 vue-awesome-picker
⚠️ DEPRECATED 本组件停止维护 ⚠️Vue 组件库请移步 Vant ⚠️有赞前端大量坑位,内推私信 vue-awesome-picker Features 支持单列.多列和联级数据 内置时 ...
- vue 添加全局组件_自定义vue全局组件(Loading为例)
首先创建一个项目 vue init webpack-simple define-demo //define-demo 项目名称 cd define-demo npm install //安装本次所有需 ...
- axios vue 回调函数_前端Vue 面试题大全
点蓝色字关注"程序员报刊" 「 学习 新闻 招聘 」 vue的底层原理? vue组件之间的通信? JS中判断数据类型的方法有几种? 最常见的判断方法:typeof 判断已知对象类 ...
- 覆盖vue.js样式_使用Vue.js和Cloudinary在化身上覆盖眼镜/面罩
覆盖vue.js样式 Deep Learning, a subset of machine learning, helps break down tasks in ways that makes al ...
- vue 路由重定向_使用Vue和Vue路由器进行高级路由:重定向和Nav Guard
vue 路由重定向 While the basics of routing in Vue.js have already been covered, today we'll explore some ...
最新文章
- keras Classifier 分类
- HMM -GMM 理清不错
- Shell中read的常用方式
- 第十二届蓝桥杯省赛第二场C++B组真题 【未完结】
- how can you understand the world
- PHP面向对象 封装与继承
- nodejs 获取cpu核心数量_用 NodeJS 充分利用多核 CPU 的资源[每日前端夜话0xCB]
- pyqt5 下拉 多页 点击_PyQt5实战——自定义翻页控件实现
- 现在最流行哪款有linux系统,哪一个Linux发行版最流行?
- The stacking context
- 【概率论与数理统计】小结7 - 统计学中的基本概念
- 基于高德地图的城市区域代码表
- 游戏毕业设计参考文献合集
- 软件测试实例:登录功能怎么设计测试用例
- 一文说清长安链ChainMaker同步模块
- 用Python进行web开发需要学习什么?
- 天的各种书法_你可知道书法里的各种关系?
- 字符串操作函数的实现【详解】
- 解决开机提示High Severity Error问题
- Bugzilla的bug状态