1.0.9 • Published 5 years ago

vue-photo-preview-fork v1.0.9

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

vue-photo-preview-fork

基于vue-photo-preview插件进行ie兼容性处理,并且支持typeScript

使用

# 安装
npm install vue-photo-preview-fork --save
# 引入
import preview from 'vue-photo-preview-fork'
import 'vue-photo-preview-fork/dist/skin.css'
Vue.use(preview)
//或者 
//var option={....} option配置请查看 http://photoswipe.com/documentation/options.html
//Vue.use(preview,option)
# umd
<link rel="stylesheet" type="text/css" href="路径/dist/skin.css"/>

<script src="路径/dist/vue-photo-preview.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	var options={
		fullscreenEl:false //关闭全屏按钮
	}
	
	Vue.use(vuePhotoPreview,options)
	
	new Vue({
		el:'#app'
	})
</script>
# html
//在img标签添加preview属性 preview值相同即表示为同一组
<img src="xxx.jpg" preview="0" preview-text="描述文字">

//分组
<img src="xxx.jpg" preview="1" preview-text="描述文字">
<img src="xxx.jpg" preview="1" preview-text="描述文字">

<img src="xxx.jpg" preview="2" preview-text="描述文字">
<img src="xxx.jpg" preview="2" preview-text="描述文字">

<img src="xxx.jpg" large="xxx_3x.jpg" preview="2" preview-text="缩略图与大图模式">

在vue项目中引入babel-polyfill(处理项目中的promise问题)

npm i babel-polyfill --save

// 在main.ts顶部引入
import 'babel-polyfill'

原插件地址

vue-photo-preview

Options

插件配置文档

DEMO

地址

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago