vue-photo-preview-fork
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

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

地址

Readme

Keywords

none

Package Sidebar

Install

npm i vue-photo-preview-fork

Weekly Downloads

1

Version

1.0.9

License

MIT

Unpacked Size

526 kB

Total Files

12

Last publish

Collaborators

  • usebtfeng