pic-viewer
Advanced tools
Comparing version 0.2.6 to 0.2.7
{ | ||
"name": "pic-viewer", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"author": "cloydlau", | ||
@@ -32,9 +32,9 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@vue/cli-plugin-babel": "~4.4.0", | ||
"@vue/cli-service": "~4.4.0", | ||
"@vue/cli-plugin-babel": "~4.5.0", | ||
"@vue/cli-service": "~4.5.0", | ||
"element-ui": "^2.13.2", | ||
"sass": "^1.26.0", | ||
"sass-loader": "^8.0.2", | ||
"sass-loader": "^9.0.0", | ||
"vue-template-compiler": "^2.6.11" | ||
} | ||
} |
@@ -8,3 +8,2 @@ # pic-viewer / 图片预览 | ||
### Feature | ||
@@ -18,14 +17,20 @@ | ||
### Installation | ||
![NPM](https://nodei.co/npm/pic-viewer.png) | ||
``` bash | ||
$ yarn add pic-viewer | ||
``` | ||
yarn add pic-viewer / npm i pic-viewer | ||
Dependencies:vue | ||
全局引入: | ||
**依赖项**:vue | ||
<hr/> | ||
**全局引入** | ||
```js | ||
import PicViewer from 'pic-viewer' | ||
Vue.use(PicViewer) | ||
``` | ||
局部引入: | ||
**局部引入** | ||
```js | ||
import { PicViewer } from 'pic-viewer' | ||
@@ -35,5 +40,37 @@ components: { PicViewer } | ||
### Quick Start | ||
请参考/demo中极简示例 | ||
**自适应瀑布流布局** | ||
```html | ||
<PicViewer :value=""/> | ||
``` | ||
**文档流布局** | ||
> 典型应用场景:表格 | ||
```html | ||
<el-table> | ||
<el-table-column label="图片"> | ||
<template slot-scope="{ row }"> | ||
<PicViewer :waterfall="false" :value="row.img"/> | ||
</template> | ||
</el-table-column> | ||
</el-table> | ||
``` | ||
**手动调用预览 不在外部陈列展示** | ||
```html | ||
<PicViewer :value="" v-show="false" ref="PicViewer"/> | ||
<el-button @click="()=>{$refs.PicViewer.preview(6)}">预览</el-button> | ||
``` | ||
| 参数 | 说明 | 类型 | 可选值 | 默认值 | | ||
| --- | --- | --- | --- | --- | | ||
| value | 图片链接 | String / Array[String] / Array[Object] | | | | ||
| objectKey | 如果数组元素为对象 需要指定图片对应的key | String | | | | ||
| waterfall | 是否瀑布流布局 | Boolean | | true | | ||
| 方法名 | 说明 | 参数 | | ||
| --- | --- | --- | | ||
| preview | 手动预览 | value数组下标(value类型为Array时需要 默认0) | |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
10491
74
1218955
9