mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 05:44:04 +08:00
优化image-preview组件
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-image class="img" :src="src" fit="cover" :style="`width:${realWidth};height:${realHeight};`" :preview-src-list="[src]">
|
||||
<div slot="error" class="image-slot">
|
||||
<svg-icon name="image-load-fail" />
|
||||
</div>
|
||||
</el-image>
|
||||
</div>
|
||||
<el-image :src="src" fit="cover" :style="`width:${realWidth};height:${realHeight};`" :preview-src-list="[src]">
|
||||
<div slot="error" class="image-slot">
|
||||
<svg-icon name="image-load-fail" />
|
||||
</div>
|
||||
</el-image>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -48,6 +46,7 @@ export default {
|
||||
.el-image {
|
||||
border-radius: 5px;
|
||||
background-color: #ebeef5;
|
||||
box-shadow: 0 0 5px 1px #ccc;
|
||||
::v-deep .el-image__inner {
|
||||
transition: all 0.3s;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
<div>
|
||||
<page-header title="图片预览" content="ImagePreview" />
|
||||
<page-main>
|
||||
<image-preview src="https://s1.ax1x.com/2020/07/03/NOeqld.jpg" :width="200" />
|
||||
<image-preview src="" width="100px" height="100px" />
|
||||
<div>
|
||||
<image-preview src="https://s1.ax1x.com/2020/07/03/NOeqld.jpg" :width="200" />
|
||||
</div>
|
||||
<div>
|
||||
<image-preview src="" width="100px" height="100px" />
|
||||
</div>
|
||||
</page-main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user