vue-preview缩略图报错解决
更新时间:2023年08月03日 11:51:12 作者:diuren1205
这篇文章主要为大家介绍了vue-preview缩略图报错解决,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪
vue-preview
因为已经更新缩略图,使用方法已经发生转变,所以才会找不到$preview
控制台错误信息
"$preview" is not defined on the instance but referenced during render
vue-preview(官网)
npm i vue-preview -S
main.js引用
import VuePreview from 'vue-preview' // defalut install Vue.use(VuePreview)
css样式
.thumbs {
/deep/ .my-gallery{ //deep深层作用选择器
display: flex;
flex-wrap:wrap;//默认换行
figure{
width: 30%;
margin: 5px;
img{
width: 100%;
box-shadow: 0 0 8px #999;
border-radius: 5px;
}
}
}Examples
<template>
<div class="thumbs">
<vue-preview :slides="slide1" @close="handleClose"></vue-preview>
</div>
</template>
<script>
export default {
data () {
return {
slide1: [
{
src: 'https://ss3.bdstatic.com/iPoZeXSm1A5BphGlnYG/skin/414.jpg?2',
msrc: 'https://ss3.bdstatic.com/iPoZeXSm1A5BphGlnYG/skin/414.jpg?2',
alt: 'picture1',
title: 'Image Caption 1',
w: 600,
h: 400
}
]
}
},
methods: {
handleClose () {
console.log('close event')
}
}
}
</script>实际展示

以上就是vue-preview缩略图报错解决的详细内容,更多关于vue-preview缩略图报错的资料请关注脚本之家其它相关文章!
相关文章
jquery imgareaselect 使用利用js与程序结合实现图片剪切
当前在ff3下,用jquery的 width()与height()函数,在不设置图片的宽度与高度的时候,不能取到 需要在图片load函数里面初始化才可以2009-07-07
JQuery触发radio或checkbox的change事件
在JQuery中,当给radio或checkbox添加一个change事件时,如果它的值发生变化就会触发change事件;本文将详细介绍如何利用JQuery触发Checkbox的change事件需要了解的朋友可以参考下2012-12-12
jQuery validate+artdialog+jquery form实现弹出表单思路详解
在项目需求中有这样一功能:在页面弹出一个form表单,ajax无刷新提交表单,表单需通过验证。下面小编给大家介绍通过jQuery validate+artdialog+jquery form实现弹出表单思路详解,需要的朋友参考下吧2016-04-04
用jQuery解决IE不支持的option disable属性
使用jQuery解决IE不支持的option disable属性2009-05-05


最新评论