Skip to content

Commit 152d294

Browse files
authored
Translation in english
1 parent 9294325 commit 152d294

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Vue preview plugin
22

3-
> 一个Vue集成[PhotoSwipe](https://github.com/dimsemenov/PhotoSwipe)图片预览插件
3+
> 一 A Vue Integrated [PhotoSwipe](https://github.com/dimsemenov/PhotoSwipe) Image Preview Plugin
44
55
![](https://img.shields.io/npm/dm/vue-preview.svg)
66
![](https://img.shields.io/npm/v/vue-preview.svg)
@@ -17,13 +17,12 @@ npm i vue-preview -S
1717

1818
## Usage
1919

20-
使用须知:
20+
Notice:
21+
- This plugin currently support vue2.0 and above
22+
- `img` tag class can not be removed
2123

22-
* 插件目前仅支持vue2.0以上版本
23-
* img标签上的class不能去掉
24+
If you are using `vue-cli` generated projects, you may need to modify the `webpack.base.conf.js` file loaders and add a loader. The reason is the plugin uses ES6 syntax, so you need to compile the code.
2425

25-
如果你是使用vue-cli生成的项目,可能需要你修改`webpack.base.conf.js`文件中的loaders,添加一个loader。
26-
原因:插件编写中使用了es6的语法,需要进行代码编译
2726
``` javascript
2827
{
2928
test: /vue-preview.src.*?js$/,
@@ -40,7 +39,7 @@ Vue.use(VuePreview)
4039

4140
### Examples
4241

43-
```
42+
```html
4443
<template>
4544
<img class="preview-img" v-for="(item, index) in list" :src="item.src" height="100" @click="$preview.open(index, list)">
4645
</template>
@@ -64,19 +63,19 @@ export default {
6463
</script>
6564
```
6665

67-
### Mothods
66+
### Methods
6867

69-
插件提供以下两个方法,```vm```代表组件实例
68+
The plugin provides the following two methods, `vm` represents a component instance:
7069

7170
#### vm.$preview.open(index, list, options)
7271

73-
参数说明:
72+
Parameters Description:
7473

75-
| 参数 | 说明 | 类型 | 必需
76-
| :--: | :--: | :--: | :--:
77-
| index |当前图片的索引值| Number |
78-
| list |图片列表 | Array |
79-
| options |预览插件的配置选项([参考PhotoSwipe配置](http://photoswipe.com/documentation/options.html) | Object |
74+
| Parameters | Description | Type | Required
75+
| :--- | :--- | :--- | :---
76+
| index |The index of the current image | Number | Yes
77+
| list |Image list | Array | Yes
78+
| options |Configuration options for Preview Plugin ([see PhotoSwipe Configuration](http://photoswipe.com/documentation/options.html)) | Object | No
8079

8180
#### vm.$preview.close()
8281

0 commit comments

Comments
 (0)