# xes-customize-ui

> A Component Library for Vue.js.

Latest version **0.1.5** (published 2021-06-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install xes-customize-ui
pnpm add xes-customize-ui
yarn add xes-customize-ui
bun add xes-customize-ui
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2021-06-11 |
| First published | 2021-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 218.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | zivenZhang |
| Maintainers | zivenzhang |

## Links

- npm: https://www.npmjs.com/package/xes-customize-ui
- Repository: https://github.com/kingzlz/xes-customize-ui
- Issues: https://github.com/kingzlz/xes-customize-ui/issues
- npm.io page: https://npm.io/package/xes-customize-ui

## Dependencies (4)

- [vue](https://npm.io/package/vue.md) ^2.6.11
- [core-js](https://npm.io/package/core-js.md) ^3.6.5
- [sweet-scroll](https://npm.io/package/sweet-scroll.md) 4.0.0
- [throttle-debounce](https://npm.io/package/throttle-debounce.md) 2.1.0

## Recent versions

- 0.1.5 (latest) — 2021-06-11
- 0.1.4 — 2021-06-07
- 0.1.3 — 2021-04-27
- 0.1.2 — 2021-04-27
- 0.1.1 — 2021-04-27
- 0.1.0 — 2021-04-02

## README

# xes-customize-ui

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn serve
```

### Compiles and minifies for production
```
yarn build
```

```sh
# Yarn
yarn add xes-customize-ui

# Npm
npm install xes-customize-ui --save
```
## Attribute

| 参数                  | 说明                                                 | 类型            | 默认值 |
| --------------------- | ---------------------------------------------------- | --------------- | ------ |
| v-model               | 显示隐藏                                             | boolean         | false  |
| img-list              | 图片数据列表['url'] 或[{url: 'url', title: 'title'}] | array           | -      |
| z-index               | css 层级                                             | number          | 2000   |
| close-on-click-mask   | 是否可以通过点击遮罩关闭 ImageViewer                 | boolean         | true  |
| close-on-press-escape | 是否可以通过按下 ESC 关闭 ImageViewer                | boolean         | true   |
| current-image-index         | 默认打开的图片索引                                   | number          | 0      |
| on-switch             | 切换回调                                             | function(index) | -      |
| showPreNextBar        | 是否展示上下一页按钮                      | boolean | false      |
| spaceAction           | 按空格键是否恢复图片原始大小                      | boolean | false      |
## Keyboard Operation

| Keyboard               | 说明                       |
| ---------------------- | -------------------------- |
| SPACE(空格键)          | 切换原图大小或屏幕缩放大小 |
| LEFT_ARROW(左方向键)   | 切换到上一张图片          |
| RIGHT_ARROW (右方向键) | 切换到下一张图片          |
| UP_ARROW(上方向键)     | 放大图片                 |
| DOWN_ARROW(下方向键)   | 缩小图片                 |

## 示例

```vue
<template>
  <div>
    <button @click="showViewer = true">预览图片</button>
    <xes-imgs-viewer
      v-model="showViewer"
      :current-image-index="imageIndex"
      :show-pre-next-bar="false"
      :close-on-press-escape="false"
      :img-list="imgList"
    />
  </div>
</template>

<script>
import { xesImageViewer } from 'xes-customize-ui';
import 'xes-customize-ui/lib/index.css';
export default {
  components: {
      xesImageViewer
  },
  data() {

    return {
      showViewer: false,
      imageIndex: 0,
      imgList: [
        {
          url: '图片地址',
          title: '图片名称', //可以没有
        },
        {
          url: '图片地址',
          title: '图片名称', //可以没有
        },
      ],
    }
  },
  methods: {},
}
</script>

<style></style>
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

---
_Source: https://npm.io/package/xes-customize-ui · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
