2025-05-15 11:51:13 +00:00
|
|
|
|
<template>
|
2025-06-03 02:54:51 +00:00
|
|
|
|
<div class="image-container">
|
|
|
|
|
<!-- 本地服务器图片 -->
|
|
|
|
|
<div class="image-box">
|
|
|
|
|
<h3>本地服务器图片</h3>
|
|
|
|
|
<img
|
|
|
|
|
src="http://localhost:3456/file/download/view=project-LGFZOJYQ"
|
|
|
|
|
alt="本地服务器图片"
|
|
|
|
|
class="responsive-image"
|
|
|
|
|
>
|
|
|
|
|
</div>
|
2025-05-15 11:51:13 +00:00
|
|
|
|
|
2025-06-03 02:54:51 +00:00
|
|
|
|
<!-- 网络图片 -->
|
|
|
|
|
<div class="image-box">
|
|
|
|
|
<h3>网络图片示例</h3>
|
|
|
|
|
<img
|
|
|
|
|
src="https://ss0.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=75398285,2076154952&fm=253&gp=0.jpg"
|
|
|
|
|
alt="示例网络图片"
|
|
|
|
|
class="responsive-image"
|
|
|
|
|
>
|
|
|
|
|
</div>
|
2025-05-15 11:51:13 +00:00
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2025-06-03 02:54:51 +00:00
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
name: 'ImageViewer',
|
|
|
|
|
// 可以在这里添加数据属性来动态设置图片URL
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 示例:动态图片URL
|
|
|
|
|
dynamicImageUrl: 'https://example.com/your-image.jpg'
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
2025-05-15 11:51:13 +00:00
|
|
|
|
|
2025-06-03 02:54:51 +00:00
|
|
|
|
<style scoped>
|
|
|
|
|
.image-container {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
gap: 30px;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
|
min-height: 100vh;
|
|
|
|
|
}
|
2025-05-15 11:51:13 +00:00
|
|
|
|
|
2025-06-03 02:54:51 +00:00
|
|
|
|
.image-box {
|
|
|
|
|
background: white;
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
|
|
|
padding: 20px;
|
|
|
|
|
max-width: 600px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
transition: transform 0.3s ease;
|
2025-05-15 11:51:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
2025-06-03 02:54:51 +00:00
|
|
|
|
.image-box:hover {
|
|
|
|
|
transform: translateY(-5px);
|
|
|
|
|
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
|
2025-05-15 11:51:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
2025-06-03 02:54:51 +00:00
|
|
|
|
.image-box h3 {
|
|
|
|
|
margin-bottom: 15px;
|
|
|
|
|
color: #333;
|
|
|
|
|
font-size: 1.5rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.responsive-image {
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
height: auto;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
border: 1px solid #eee;
|
|
|
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.responsive-image:hover {
|
|
|
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.image-url {
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
font-size: 0.9rem;
|
|
|
|
|
color: #666;
|
|
|
|
|
word-break: break-all;
|
|
|
|
|
background: #f9f9f9;
|
|
|
|
|
padding: 8px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
font-family: monospace;
|
2025-05-15 11:51:13 +00:00
|
|
|
|
}
|
|
|
|
|
</style>
|