
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
@heisea/viewer
Advanced tools
基于vue2的资源预览控件,支持放大、缩小、旋转、拖拽,支持远程图片预览、调起下载、打印,支持多图预览。
v0.2.5
v0.2.4
v0.2.3
@heisea/viewer/lib/vendors~pdfjsWorker.common.jsv0.2.2
v0.2.1
@heisea/viewer/lib/vendors~pdfjsWorker.common.jsvue.use(Viewer,options),单独使用组件时不生效。v0.2.0
v0.1.1
downloadFN允许自定义下载方法v0.1.0
进行开发
npm start
打包出生产版本 commonjs 版本
npm run build:common
npm version <newversion> | major | minor | patch]
npm publish
npm i @heisea/viewer
import Viewer from '@heisea/viewer'
Vue.use(Viewer,{
props: {
fileId: 'id',
fileName: 'originalFileName',
fileSuffix: 'ext',
fileUrl: 'url',
data: 'data'
},
http: {
filePath: 'http://hxgw.heisea.cn/base/fe/info'
},
fetch
}); // 当前组件
Vue.prototype.$fetch = fetch; // 当传参数时会调用当前获得文件
注意pdf预览,必须设置拷贝字体资源文件夹cmaps 到根目录
new CopyWebpackPlugin({
patterns: [
{
from: path.resolve(__dirname, '../node_modules/@heisea/viewer/lib/cmaps/'),
to: path.resolve(__dirname, '../dist/cmaps/')
}]
}),
1.当组件使用
<template>
<img-viewer v-bind="cfg" />
</template>
<script>
export default {
data() {
return {
cfg: {
mode: 'img',
value: 'http://bucket-cert-test.oss-cn-shanghai.aliyuncs.com/2019/10/51df3ed3-fa5f-4334-9963-6767fe63aa06.jpg'
},
};
}
};
</script>
2.函数调用 this.$viewer({value:url,options}) 支持单独配置配置当前预览器
// 直接打开图片
this.$viewer('http://bucket-cert-test.oss-cn-shanghai.aliyuncs.com/2019/10/51df3ed3-fa5f-4334-9963-6767fe63aa06.jpg');
// 直接打开id对应的资源
this.$viewer('1182133098524016641,1182222336212881410');
| 属性名 | 类型 | 说明 |
|---|---|---|
| mode | String | 显示状态node:不显示,btn:按钮,img:图片 |
| value | Auto | 显示的内容object:作为资源对象,Array:多个资源对象,String:资源地址(支持用‘,’分割多个) |
| btnLabel | String、Function | mode:btn时使用修改显示内容,默认:“查看文件”,同时支持直接 |
| http | Object | 请求配置,必须配置$fetch |
| http.filePath | String | 文件请求地址 |
| props | Object | 配置字段 |
| extend | Object | 站位节点属性配置 |
| downloadFN | Function | 自定义资源下载逻辑(url,fileName) |
FAQs
Vue solution for quickly building pages
The npm package @heisea/viewer receives a total of 8 weekly downloads. As such, @heisea/viewer popularity was classified as not popular.
We found that @heisea/viewer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.