0.0.8 • Published 2 years ago

vzi-element v0.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

vzi-element

A Vue.js component for Vzenith

Build Setup

npm install
npm run serve
npm run build

lib Setup:打包组件

1.修改版本号:package.json 
2.打包:npm run lib 
3.发布:npm publish

安装

推荐使用 npm 的方式

npm i vzi-element -S

在 main.js 中写入以下内容:

import VziElement from 'vzi-element';

Vue.use(VziElement);

在页面使用组件:

<vzi-img-viewer />

组件

1.vziImg 图片

<vzi-img src="" :width="600"/>

Attributes

参数说明类型可选值默认值
alt同原生string""
src同原生string""
fit同原生 object-fitstringfill / contain / cover / none / scale-down
width宽度Number600
height高度stringauto
draw-line是否开启坐标画线,一般用于车载项目booleantrue/falsefalse
down-load是否触摸显示下载按钮booleantrue/falsefalse
draw-list画线坐标数据Object{ berth_pos:"泊位坐标", car_pos:"车身坐标",parking_pos:"车牌坐标",resolution:"原始图片的宽高",img:"图片地址" }
img-viewer点击图片预览booleantrue/falsefalse
trigger-tip显示图片信息stringhover/fixedfixed
1.图片开启draw-line时,必须同时传入width,height
2.eg:draw-list:{
berth_pos: "{\"point\":[{\"x\":544,\"y\":469},{\"x\":1018,\"y\":363},{\"x\":1018,\"y\":1746},{\"x\":151,\"y\":1636}],\"point_num\":4,\"reco_zone_size_factor\":{\"factor_h\":2048,\"factor_w\":2048}}",
car_pos: "{\"bottom\":266,\"left\":404,\"right\":1008,\"top\":3}",
img: "http://qiniu-test.vzicar.com/imgs/98e099eb-772d070f/20220303/1646271804_-939437491_98e099eb-772d070f_0_48262853_T1089_full.jpg",
resolution: "{\"height\":1080,\"width\":1920}",
parking_pos: "{\"point\":[{\"x\":1069,\"y\":458},{\"x\":1506,\"y\":528},{\"x\":1830,\"y\":1135},{\"x\":2009,\"y\":1854},{\"x\":1092,\"y\":1906}],\"point_num\":5,\"reco_zone_size_factor\":{\"factor_h\":2048,\"factor_w\":2048}}"
}

Events

事件名称说明回调参数
on-click图片点击事件

Slot

参数说明
tooltip触发 triggerTip 显示的自定义HTML元素,与triggerTip搭配使用

2.vziImgViewer 图片预览

<vzi-img-viewer :url-list="[{url:''}]" />

Attributes

参数说明类型可选值默认值
initial-index初始展示图序列号Number0
url-list预览图列表Array{url:'',...}
z-index图片预览的 z-indexNumber20000
close-on-press-escape是否可以通过按下 ESC 关闭 Dialogbooleantrue/falsetrue
draw-line是否开启坐标画线,一般用于车载项目booleantrue/falsefalse

Events

事件名称说明回调参数
on-close关闭全屏预览按钮
on-switch切换图片index
1.图片开启draw-line时,必须同时传入width,height
2.eg:url-list:[{
    img:'',//必须
}]

3.vzi-dialog 弹框

<vzi-dialog/>

Attributes

参数说明类型可选值默认值
drag弹框是否可拖拽booleantrue/falsefalse
direction弹框打开方向Stringleft/right/center/bottom/topcenter
z-index图片预览的 z-indexNumber20000
close-on-press-escape是否可以通过按下 ESC 关闭 Dialogbooleantrue/falsetrue
width弹框宽度String60%

Events

事件名称说明回调参数
on-close关闭全屏预览按钮

4.vzi-video 实时视频

目前公司采用Jessibuca(纯H5直播流播放器),即本组件是基于Vue版本的Jessibuca播放器,加以自定义UI的二次封装

<vzi-video/>

Attributes

参数说明类型可选值默认值
playbooleantrue/falsefalse

Events

事件名称说明回调参数
on-close关闭播放
0.0.8

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago