Skip to content

Commit e6d8902

Browse files
committed
添加md说明
1 parent 872ebef commit e6d8902

File tree

1 file changed

+33
-22
lines changed

1 file changed

+33
-22
lines changed

README.md

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,41 @@
1-
# vue-code-diff
1+
# [vue-code-diff](https://www.npmjs.com/package/vue-code-diff)
22

3-
> A Vue.js project
3+
> 代码比对展示
44
5-
## Build Setup
6-
7-
``` bash
8-
# install dependencies
9-
npm install
10-
11-
# serve with hot reload at localhost:8080
12-
npm run dev
5+
## 安装
6+
```shell
7+
yarn add vue-code-diff
8+
```
139

14-
# build for production with minification
15-
npm run build
10+
## 使用
11+
```vue
12+
<template>
13+
<div>
14+
<code-diff :old-string="oldStr" :new-string="newStr" :context="10" />
15+
</div>
16+
</template>
17+
18+
import vueCodeDiff from 'vue-code-diff'
19+
export default {
20+
components: {vueCodeDiff},
21+
data(){
22+
return {
23+
oldStr: 'old code',
24+
newStr: 'new code'
25+
}
26+
}
27+
}
28+
```
1629

17-
# build for production and view the bundle analyzer report
18-
npm run build --report
30+
## 参数说明
1931

20-
# run unit tests
21-
npm run unit
32+
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
33+
|---------- |-------- |---------- |------------- |-------- |
34+
| old-string| 陈旧的字符串| string |||
35+
| new-string| 新的字符串| string |||
36+
| context| 不同地方上下间隔多少行不隐藏 | number |||
2237

23-
# run e2e tests
24-
npm run e2e
2538

26-
# run all tests
27-
npm test
28-
```
39+
## 效果展示
2940

30-
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
41+
![image](https://github.com/ddchef/vue-code-diff/blob/master/2018050615272.png?raw=true)

0 commit comments

Comments
 (0)