照片放大功能h5
这里就不放图了,放大的是别人的身份证
<template>
<div class="image-cell__wrapper" :style="border">
<span class="title" :style="{color: titleColor}">{{ imageTitle }}</span>
<span class="icon-image"></span>
<span class="image-wrapper">
<img v-for="(item, key) in realImage" :src="imageHandle(item, 80, 80)" alt="image">
</span>
<span class="icon-arrow" v-if="arrow"></span>
<div v-if="inlineBorder"
class="inline-border"></div>
</div>
</template>
<script>
import { imgHandle } from '@/utils/tool'
export default {
name: 'imageCell',
props: {
imageTitle: {
type: String,
required: true
},
image: {
required: false
},
arrow: {
type: Boolean,
default: true
},
titleColor: {
type: String,
default: '#575fb6'
},
inlineBorder: {
type: Boolean,
default: false
},
hasBorder: {
type: Boolean,
default: false
}
},
data () {
return {
border: {
borderBottom: this.hasBorder ? '1px solid #ececec' : ''
}
}
},
created () {
},
computed: {
realImage () {
if (this.image) {
return this.image.length > 5 ? this.image.slice(0, 5) : this.image
}
}
},
methods: {
imageHandle (url, w, h) {
return imgHandle(url, w, h)
}
}
}
</script>
<style lang="stylus" scoped>
@import "~@/assets/mixin.stylus"
.image-cell__wrapper{
position relative
width 9rem
padding 0 .5rem
height 1.5rem
line-height 1.5rem
background-color white
font-dpr(16px)
color #4A4A4A
.title{
color #575fb6
}
.icon-image{
display inline-block
width .5rem
height .4rem
bg-image('./img/picture')
background-size contain
vertical-align middle
}
.image-wrapper{
display inline-block
position absolute
right 1rem
img{
display inline-block
vertical-align middle
padding-left .3rem
width .6rem
height .6rem
}
}
.icon-arrow{
position relative
top .6rem
float right
display inline-block
width .2rem
height .4rem
bg-image('~@/assets/img/arrow')
background-size contain
}
.inline-border{
position absolute
bottom 0
left .4rem
width 9.6rem
height 1px
background-color #ECECEC
}
}
</style>
tool.js里面的imgHandle
@function imgHandle 切割图片
function imgHandle (url, width, height) {
const fontSize = document.documentElement.style.fontSize.split('px')[0]
return url + '?imageView2/1/w/' + (fontSize / 75 * width * 5).toFixed(0) + '/h/' + (fontSize / 75 * height * 5).toFixed(0) + '/q/100'
}
export { imgHandle }
export default { imgHandle }
照片放大功能h5的更多相关文章
- 图片放大功能插件及jquery.extend函数理解
前端时间,产品提出社区评论中的图片需要有放大功能.感觉可以共用,所以就想整合一个插件,过程中也借鉴了一些例子. 分析下自己的代码思路: var scaleImg = function(opts) { ...
- jQuery.YesShow - 图片轮播插件(带图片放大功能)
jQuery.YesShow - 图片轮播插件(带图片放大功能) 使用简单,原文件只要这样就可以了:<div id="yes"> <ul> ...
- 刑天DDOS攻击器下一版本即将使用NTP放大功能
刑天DDOS攻击器下一版本即将使用NTP放大功能 在一次无语实验中无意发现NTP方法后的攻击流量相当可观,Linux实测G口高达30G,也就是说最大可以放大30倍的攻击流量是何等的威武.而 ...
- 图片放大功能如何做?jquery实现
花了很长时间撸了个网站,观点,其中需要一个图片放大功能,网上找了半天发现都没有中意的,最后无奈之下自己写了一个,演示地址,演示图片: 自我感觉效果还不错,现在分享开来给大家看看,哪里不好还请多多指教, ...
- jqzoom插件图片放大功能的一些BUG
建议使用cloud-zoom插件,jqzoom插件就不要使用了 点击查看——图片放大镜——jQuery插件Cloud Zoom 刚开始使用的是jqzoom插件,但问题太多了,就不说插入到页面中使用了, ...
- JS-以鼠标位置为中心的滑轮放大功能demo1
以鼠标位置为中心的滑轮放大功能demo1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" &qu ...
- css3通过scale()实现放大功能、通过rotate()实现旋转功能
css3通过scale()实现放大功能.通过rotate()实现旋转功能,下面有个示例,大家可以参考下 通过scale()实现放大功能 通过rotate()实现旋转功能 而transition则可设置 ...
- Typora配置双击图片放大功能
在Typora中,默认没有点击图片放大功能,本文就教大家如何配置该功能. 我的环境版本 Typora版本:0.11.13 LightBox版本:2.11.3 下载LightBox 可以从Github下 ...
- 照片放大软件PhotoZoom怎么用?
做设计时,难免常常要上网找一些图片素材,但是有时候我们找到图片效果不尽人意,图片风格符合设计要求的的却图片太小,用photoshop放大后,图片的色块像素就出来了,效果极为不理想,这就要我们将图片进行 ...
随机推荐
- Linux:检查当前运行级别的五种方法
运行级就是Linux操作系统当前正在运行的功能级别.存在七个运行级别,编号从0到6.系统可以引导到任何给定的运行级别.运行级别由数字标识. 每个运行级别指定不同的系统配置,并允许访问不同的进程组合.默 ...
- Web漏洞扫描
SkipFish skipfish语法格式,其他参数使用skipfish -h查看文档 skipfish -o skfish http://url/ -C 指定Cookie 最终会在~/root下面生 ...
- Kubernetes第十一章--部署微服务电商平台
- webpack4引入JQuery的两种方法
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/weixin_36185028/artic ...
- win10设置锁屏密码
1.点击右下角窗口键 2.选择点击设置 3.点击账户 4.点击登录选项 5.点击密码,添加密码 6.设置密码 7.使用快捷键“窗口键+l”锁屏,就会提示你输入密码
- jquery实现倒计时
<html> <head> <meta charset="utf-8"/> <title>jquery实现倒计时</title ...
- JS-练习题
1.foo()结果 function foo() { bar.apply(null, arguments); } function bar(){ console.log(arguments); } f ...
- 软工个人项目———WC.exe(Java实现)
一.github地址 https://github.com/hhw-15521301615/hello-world 二.PSP表格 PSP2.1 Personal Software Process S ...
- python基础-函数递归
函数递归 概念:直接或间接地重复调用函数本身,是一种函数嵌套调用的表现形式. 直接调用:在函数内部,直接调用函数本身 def foo(): print("这是foo函数") foo ...
- 基于 K8S 集群安装部署 istio-1.2.4
使用云平台可以为组织提供丰富的好处.然而,不可否认的是,采用云可能会给 DevOps 团队带来压力.开发人员必须使用微服务以满足应用的可移植性,同时运营商管理了极其庞大的混合和多云部署.Istio 允 ...