
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
vue3-image-viewer
Advanced tools
```npm i vue3-image-viewer``` 或者/or ```yarn add vue3-image-viewer```
npm i vue3-image-viewer
或者/or
yarn add vue3-image-viewer
import { Image } from "vue3-image-viewer";
import "vue3-image-viewer/dist/style.css"
<script setup lang="ts">
const imgs = [
"https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg",
"https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg",
"https://fuss10.elemecdn.com/9/bb/e27858e973f5d7d3904835f46abbdjpeg.jpeg",
];
const images = [
{ url: imgs[0], thumbnail: imgs[0], title: "标题", desc: "描述" },
{ url: imgs[1], thumbnail: imgs[1], title: "标题", desc: "描述" },
{ url: imgs[2], thumbnail: imgs[2], title: "标题", desc: "描述" },
];
</script>
<template>
<div id="app">
<div class="image">
<div class="item" v-for="(item, index) in images" :key="item.url">
<Image
:src="item.url"
:images="images"
fit="contain"
width="100%"
preview
:aspectRatio="9 / 16"
hideOnClickModal
:initialIndex="index"
loop
/>
</div>
</div>
<div class="viewer">
<Viewer
style="width: 100%; height: 100%"
:images="images"
navigation
toolbar
loop
/>
</div>
</div>
</template>
<style lang="less">
html,
body,
#app {
margin: 0;
padding: 0;
}
#app {
width: 800px;
margin: 100px auto;
.image {
display: flex;
flex-wrap: wrap;
.item {
width: 33.3%;
box-sizing: border-box;
padding: 0 5px;
}
}
.viewer {
margin-top: 20px;
width: 800px;
height: 500px;
}
}
</style>
##Image组件说明
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| base | 地址前缀 | string | "" |
| src | 图片地址 | string | "" |
| token | token参数 | string | "" |
| aspectRatio | 固定宽高比 | number | 0 |
| fit | object-fit | string | "none" |
| lazy | 懒加载 | boolean | false |
| hideOnClickModal | 点击遮罩关闭预览 | boolean | false |
| initialIndex | 初始预览图像索引 | number | 0 |
| preview | 是否开启预览 | boolean | false |
| images | 预览列表 | array | [] |
| loop | 开启循环 | boolean | false |
| preload | 预览预加载 | array or boolean | [0,2] |
| width | 盒子宽度 | string | "" |
| height | 盒子高度 | string | "" |
| alt | alt | string | "" |
| referrerPolicy | referrerPolicy | string | "" |
| bgColor | 背景颜色 | string | "black" |
##Viewer组件说明
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| images | 图片列表 | array | [] |
| navigation | 底部预览条 | boolean | false |
| toolbar | 工具栏 | boolean | false |

目前还在开发中,可能更新会比较频繁,bug也比较多,安装新的包之前最好先删除yarn.lock文件,以确保最新内容生效
FAQs
`npm i vue3-image-viewer` 或者/or `yarn add vue3-image-viewer`
The npm package vue3-image-viewer receives a total of 43 weekly downloads. As such, vue3-image-viewer popularity was classified as not popular.
We found that vue3-image-viewer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.