vue前端开发--图片查看大图插件 vue-photo-preview
使用方法安装npm install vue-photo-preview --save引入配置# 引入import preview from 'vue-photo-preview'import 'vue-photo-preview/dist/skin.css'Vue.use(preview)直接使用# html//在img标签添加preview属性 p...
·
使用方法
安装
npm install vue-photo-preview --save
引入配置
# 引入
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
Vue.use(preview)
直接使用
# 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="描述文字">
配置 (一般使用不需要进行配置)
# 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>
demo地址
https://826327700.github.io/vue-photo-preview/demo/
转载原址
https://826327700.github.io/vue-photo-preview/
更多推荐
已为社区贡献2条内容
所有评论(0)