Skip to content

Commit ea4f204

Browse files
committed
build: v0.3.12
1 parent 4798e44 commit ea4f204

8 files changed

Lines changed: 9457 additions & 100 deletions

File tree

README-zh.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# VCodeDiff
22

3-
Vue2 / Vue3 可用的 code diff 插件
3+
Vue2 / Vue3 可用的 code diff 插件
44
[vue-code-diff](https://github.com/ddchef/vue-code-diff) 的 vue3 版本, 参考了大幅代码,在这里表示感谢
55

66
# 如何安装?
@@ -111,30 +111,31 @@ export default {
111111

112112
# 事件
113113

114-
| 事件名称 | 说明 | 回调参数 |
115-
|---------------|---------|---------- |
116-
| before-render | 渲染前触发 | - |
117-
| after-render | 渲染后触发 | - |
114+
115+
| 事件名称 | 说明 | 回调参数 |
116+
| ------------- | ---------- | -------- |
117+
| before-render | 渲染前触发 | - |
118+
| after-render | 渲染后触发 | - |
118119

119120
# 参数
120121

121-
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
122-
|------------------------|-----------------------------------------------------------------------------------------------------------------------|---------- |------------- |--------------|
123-
| highlight | 控制是否高亮代码 | boolean | - | true |
124-
| language | 代码语言,如 `typescript`。不填会自动判断。 [查看全部支持语言](https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md) | string | - | - |
125-
| old-string | 陈旧的字符串 | string | - | - |
126-
| new-string | 新的字符串 | string | - | - |
127-
| context | 不同地方上下间隔多少行不隐藏 | number | - | - |
128-
| outputFormat | 展示的方式 | string | line-by-line,side-by-side | line-by-line |
129-
| drawFileList | 展示对比文件列表 | boolean | - | false |
130-
| renderNothingWhenEmpty | 当无对比时不渲染 | boolean | - | false |
131-
| diffStyle | 差异风格, 单词级差异或字母级差异 | string | word, char | word |
132-
| fileName | 文件名 | string | - | - |
133-
| isShowNoChange | 当无对比时展示源代码 | boolean | - | false |
134-
| trim | 移除字符串前后空白字符 | boolean | - | false |
135-
| language | 对比的文本语言 | boolean | - | false |
136-
| noDiffLineFeed | 不 diff windows 换行符(CRLF)与 linux 换行符(LF) | boolean | - | false |
137-
| syncScroll | 是否同步滚动 | boolean | - | true |
122+
123+
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
124+
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -------------------------- | ------------ |
125+
| highlight | 控制是否高亮代码 | boolean | - | true |
126+
| language | 代码语言,如`typescript`。不填会自动判断。 [查看全部支持语言](https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md) | string | - | - |
127+
| old-string | 陈旧的字符串 | string | - | - |
128+
| new-string | 新的字符串 | string | - | - |
129+
| context | 不同地方上下间隔多少行不隐藏 | number | - | - |
130+
| outputFormat | 展示的方式 | string | line-by-line,side-by-side | line-by-line |
131+
| drawFileList | 展示对比文件列表 | boolean | - | false |
132+
| renderNothingWhenEmpty | 当无对比时不渲染 | boolean | - | false |
133+
| diffStyle | 差异风格, 单词级差异或字母级差异 | string | word, char | word |
134+
| fileName | 文件名 | string | - | - |
135+
| isShowNoChange | 当无对比时展示源代码 | boolean | - | false |
136+
| trim | 移除字符串前后空白字符 | boolean | - | false |
137+
| language | 对比的文本语言 | boolean | - | false |
138+
| noDiffLineFeed | 不 diff windows 换行符(CRLF)与 linux 换行符(LF) | boolean | - | false |
138139

139140
# 与 vue-code-diff 的不同
140141

@@ -144,6 +145,10 @@ export default {
144145

145146
# 变更记录
146147

148+
### 0.3.12
149+
150+
1. 撤销 prop `syncScroll` 因为有 bug。现在默认开启同步滚动
151+
147152
### 0.3.11
148153

149154
1. 增加 prop `syncScroll` 用于控制横向滚动条是否同步滚动

README.md

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# VCodeDiff
22

3-
[![NPM version](https://img.shields.io/npm/v/v-code-diff.svg?style=flat)](https://www.npmjs.com/package/v-code-diff)
3+
[![NPM version](https://img.shields.io/npm/v/v-code-diff.svg?style=flat)](https://www.npmjs.com/package/v-code-diff)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
55
[![Downloads](https://img.shields.io/npm/dt/v-code-diff?minimal=true)](https://www.npmjs.com/package/v-code-diff)
66

@@ -117,29 +117,31 @@ export default {
117117

118118
# Events
119119

120-
| Event Name | Description | Callback Params |
121-
|---------- |-------- |---------- |
122-
| before-render | hook before rendering | - |
123-
| after-render | hook after rendering | - |
120+
121+
| Event Name | Description | Callback Params |
122+
| ------------- | --------------------- | --------------- |
123+
| before-render | hook before rendering | - |
124+
| after-render | hook after rendering | - |
124125

125126
# Props
126127

127-
| Prop | Description | Type | Optional | Default |
128-
|---------- |-------- |---------- |------------- |-------- |
129-
| highlight| control whether to highlight the code | boolean | - | true |
130-
| language| code language,such as `typescript`. If you don't input, it will be judged automatically. [view all supported languages](https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md) | string | - | - |
131-
| old-string| old string | string | - | - |
132-
| new-string| new string| string | - | - |
133-
| context| number of show context lines | number | - | - |
134-
| outputFormat| show method | string | line-by-line,side-by-side | line-by-line |
135-
| drawFileList | show files list | boolean | - | false |
136-
| renderNothingWhenEmpty | render nothing when empty | boolean | - | false |
137-
| diffStyle | difference style | string | word, char | word |
138-
| fileName | file name | string | - | |
139-
| isShowNoChange | show raw when no change | boolean | - | false |
140-
| trim | Remove blank characters before and after the string | boolean | - | false |
141-
| language | code language | boolean | - | false |
142-
| noDiffLineFeed | Do not diff windows line feed (CRLF) and linux line feed (LF) | boolean | - | false |
128+
129+
| Prop | Description | Type | Optional | Default |
130+
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -------------------------- | ------------ |
131+
| highlight | control whether to highlight the code | boolean | - | true |
132+
| language | code language,such as`typescript`. If you don't input, it will be judged automatically. [view all supported languages](https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md) | string | - | - |
133+
| old-string | old string | string | - | - |
134+
| new-string | new string | string | - | - |
135+
| context | number of show context lines | number | - | - |
136+
| outputFormat | show method | string | line-by-line,side-by-side | line-by-line |
137+
| drawFileList | show files list | boolean | - | false |
138+
| renderNothingWhenEmpty | render nothing when empty | boolean | - | false |
139+
| diffStyle | difference style | string | word, char | word |
140+
| fileName | file name | string | - | |
141+
| isShowNoChange | show raw when no change | boolean | - | false |
142+
| trim | Remove blank characters before and after the string | boolean | - | false |
143+
| language | code language | boolean | - | false |
144+
| noDiffLineFeed | Do not diff windows line feed (CRLF) and linux line feed (LF) | boolean | - | false |
143145

144146
# Difference from [vue-code-diff](https://github.com/ddchef/vue-code-diff)
145147

@@ -149,6 +151,10 @@ export default {
149151

150152
# ChangeLog
151153

154+
### 0.3.12
155+
156+
1. Remove prop `syncScroll` due to bug. Synchronized scrolling is now enabled by default
157+
152158
### 0.3.11
153159

154160
1. Add prop `syncScroll` to control whether the horizontal scroll bar needs to be scrolled synchronously
@@ -169,7 +175,7 @@ export default {
169175
### 0.3.7
170176

171177
1. Fix the problem of displaying "File Without Change..." when isShowNoChange is true and the old and new codes are different,
172-
then show all the source code
178+
then show all the source code
173179

174180
### 0.3.6
175181

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "v-code-diff",
33
"description": "A diff plugin of vue, support vue2 and vue3",
4-
"version": "0.3.11",
4+
"version": "0.3.12",
55
"scripts": {
66
"dev": "pnpm switch:3 && vite",
77
"dev:2": "pnpm switch:2 && cd ./dev/vue2.7 && pnpm dev",
@@ -48,7 +48,7 @@
4848
"diff": "^5.0.0",
4949
"diff2html": "^3.4.5",
5050
"highlight.js": "^10.5.0",
51-
"vue-demi": "latest"
51+
"vue-demi": "^0.13.6"
5252
},
5353
"devDependencies": {
5454
"@ant-design-vue/use": "^0.0.1-alpha.10",

0 commit comments

Comments
 (0)