最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue.js實(shí)現(xiàn)照片放大功能

 更新時(shí)間:2020年06月23日 11:24:18   作者:周小姐你好  
這篇文章主要為大家詳細(xì)介紹了vue.js實(shí)現(xiàn)照片放大功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了vue.js實(shí)現(xiàn)照片放大的具體代碼,供大家參考,具體內(nèi)容如下

這里就不放圖了,放大的是別人的身份證

<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 }

關(guān)于vue.js組件的教程,請大家點(diǎn)擊專題vue.js組件學(xué)習(xí)教程進(jìn)行學(xué)習(xí)。

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • vue+element 多個(gè)相同的select不允許重復(fù)選擇問題

    vue+element 多個(gè)相同的select不允許重復(fù)選擇問題

    這篇文章主要介紹了vue+element 多個(gè)相同的select不允許重復(fù)選擇問題,具有很好的參考價(jià)值,希望對大家有所幫助。
    2022-07-07
  • vue表單驗(yàn)證你真的會了嗎?vue表單驗(yàn)證(form)validate

    vue表單驗(yàn)證你真的會了嗎?vue表單驗(yàn)證(form)validate

    這篇文章主要介紹了vue表單驗(yàn)證你真的會了嗎?vue表單驗(yàn)證(form)validate,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-04-04
  • 深入理解vuex2.0 之 modules

    深入理解vuex2.0 之 modules

    本篇文章主要介紹了vuex2.0 之 modules,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-11-11
  • 使用Vue?Query實(shí)現(xiàn)高級數(shù)據(jù)獲取的示例詳解

    使用Vue?Query實(shí)現(xiàn)高級數(shù)據(jù)獲取的示例詳解

    構(gòu)建現(xiàn)代大規(guī)模應(yīng)用程序最具挑戰(zhàn)性的方面之一是數(shù)據(jù)獲取,這也是?Vue?Query?庫的用途所在,下面就跟隨小編一起學(xué)習(xí)一下如何利用Vue?Query實(shí)現(xiàn)高級數(shù)據(jù)獲取吧
    2023-08-08
  • Vue模擬el-table演示插槽用法的示例詳解

    Vue模擬el-table演示插槽用法的示例詳解

    很多人知道插槽分為三種,但是實(shí)際到elementui當(dāng)中為什么這么用,就一臉懵逼,接下來就跟大家聊一聊插槽在elementui中的應(yīng)用,并且自己寫一個(gè)類似el-table的組件,感興趣的可以了解一下
    2023-05-05
  • Vue.js動態(tài)組件解析

    Vue.js動態(tài)組件解析

    這篇文章主要為大家詳細(xì)介紹了Vue.js動態(tài)組件,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2016-09-09
  • Vue前端開發(fā)之實(shí)現(xiàn)交錯(cuò)過渡動畫效果

    Vue前端開發(fā)之實(shí)現(xiàn)交錯(cuò)過渡動畫效果

    這篇文章主要為大家詳細(xì)介紹了如何通過Vue實(shí)現(xiàn)交錯(cuò)過渡動畫效果,文中的示例代碼講解詳細(xì),感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下
    2024-11-11
  • Vue列表頁渲染優(yōu)化詳解

    Vue列表頁渲染優(yōu)化詳解

    這篇文章主要為大家詳細(xì)介紹了Vue列表頁渲染優(yōu)化的操作,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-07-07
  • Vue自定義Form組件實(shí)現(xiàn)方法介紹

    Vue自定義Form組件實(shí)現(xiàn)方法介紹

    這篇文章主要介紹了Vue自定義Form組件的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧
    2022-10-10
  • webpack項(xiàng)目調(diào)試以及獨(dú)立打包配置文件的方法

    webpack項(xiàng)目調(diào)試以及獨(dú)立打包配置文件的方法

    下面小編就為大家分享一篇webpack項(xiàng)目調(diào)試以及獨(dú)立打包配置文件的方法,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-02-02

最新評論

大方县| 灵武市| 松桃| 敦化市| 汉源县| 余干县| 武冈市| 北安市| 郧西县| 股票| 衡南县| 丰台区| 南城县| 遵化市| 洮南市| 海口市| 余江县| 建德市| 镇远县| 黔江区| 迭部县| 颍上县| 阳泉市| 康平县| 乌拉特后旗| 高安市| 白玉县| 连山| 阿勒泰市| 保山市| 炉霍县| 黑龙江省| 湖口县| 呼图壁县| 南开区| 新密市| 龙里县| 清苑县| 梁平县| 白水县| 扶余县|