1.0.0-beta.1 • Published 3 years ago

@lx-vue-materiel/ui v1.0.0-beta.1

Weekly downloads
41
License
ISC
Repository
gitlab
Last release
3 years ago

@lx-vue-materiel/ui

包含所有物料汇总报

添加包

  1. 添加依赖
lerna add @lx-vue-materiel/info-table --scope=@lx-vue-materiel/ui

@lx-vue-materiel/info-table 替换成自己包名

  1. 导出依赖

index.js 增加一行,如下:

export { default as infoTable } from '@lx-vue-materiel/info-table';

export default {};

Usage

<template>
  <div>
    <info-table title="基本信息" :infoList="list" ></info-table>
  </div>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { infoTable } from '@lx-vue-materiel/ui';

@Component({
  components: {
    infoTable,
  },
})
export default class HelloWorld extends Vue {
  list = [
    {
      subTitle: '子标题1',
      items: [
        { title: '车辆VIN码', value: 'LB1WA5884A8008781' },
        { title: '表显里程(公里)', value: '2832566' },
        { title: '排量(L)', value: '3.982' },
        { title: '排放标准', value: '低于国一' },
      ],
    },
  ];
}
</script>

img-preview

组件形式打开

 <ImgPreview
  :imgsData="imgsData"
  :showIndex="showIndex"
  :visible.sync="visible"
  :options="{}"
></ImgPreview>
  1. 传入props
props说明类型默认值
visible.sync预览组件是否展示booleanfalse
imgsData图片数组,请传入字符串数组格式array[]
showIndex展示图片索引number0
options配置对象object{}
  1. 配置对象options说明,不传代表默认
key说明类型默认值
clickMaskClose点击mask是否关闭图片booleanfalse
closeIcon是否展示关闭按钮booleantrue
width图片默认显示宽度。 高度自适应number800
scale缩放 按钮booleantrue
rotateLeft顺时针旋转 按钮booleantrue
rotateRight逆时针旋转 按钮booleanfalse
download下载 按钮booleanfalse
stepScale缩放step (建议不修改)number0.1
maxScale最大放大倍数 (建议不修改)number5
minScale最小放大倍数 (建议不修改)number0.1
stepRotate默认每次旋转度数 90 度 (建议不修改)number90
isAnimation是否执行缩放等动画 (建议不修改)booleantrue
downloadName下载图片名称string'timp.jpg'
  1. 提供插槽slot name=previewEdit 可自定义底部按钮,传递参数index 当前图片的索引值

引入调用和全局引入调用形式打开

  1. 引入调用
import imgPreview from '@lx-vue-materiel/img-preview';
// 展示
ImgPreview.visible({
  imgsData: [], // 图片数组,请传入字符串数组格式
  showIndex: 0,  // 展示图片索引
  options: {} // 配置对象
})
// 隐藏
ImgPreview.hide()
  1. 全局引入调用
import imgPreview from '@lx-vue-materiel/img-preview';
Vue.use(ImgPreview)

// 展示
this.ImgPreview.visible({
  imgsData: [], // 图片数组,请传入字符串数组格式
  showIndex: 0,  // 展示图片索引
  options: {} // 配置对象
})
// 隐藏
this.ImgPreview.hide()