vue-photo-preview-fork
v1.0.9
Published
"基于vue-photo-preview的组件进行ie兼容性适配,支持typescript"
Downloads
24
Readme
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'