Skip to content

Commit

Permalink
build: v0.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Shimada666 committed Nov 23, 2021
1 parent eb425f2 commit dccefa8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
8 changes: 8 additions & 0 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ export default {

# 变更记录

### 0.3.7

1. 修复当 isShowNoChange 为 true 时,而新旧代码不同时仍展示 “File Without Change” 的问题。然后展示全部源代码

### 0.3.6

1. 添加 prop `language`,能让高亮更准确

### 0.3.5

1. side-by-side 模式中,支持左右同步滚动
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ export default {

# ChangeLog

### 0.3.7

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

### 0.3.6

1. Add prop `language`, make highlighting more accurate
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "v-code-diff",
"description": "A diff plugin of vue, support vue2 and vue3",
"version": "0.3.6",
"version": "0.3.7",
"scripts": {
"dev": "vite",
"build": "npx rimraf dist && rollup --config rollup.config.js",
Expand Down
6 changes: 4 additions & 2 deletions src/lib/v-code-diff/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ export function useDebounceFn (fn, delay) {
export const createHtml = (props: Props) => {
let oldString = props.trim ? props.oldString.trim() : props.oldString
let newString = props.trim ? props.newString.trim() : props.newString
if (props.isShowNoChange) {
let context = props.context
if (props.isShowNoChange && oldString === newString) {
oldString = 'File Without Change\tOldString: ======================== \n' + oldString
newString = 'File Without Change\tNewString: ======================== \n' + newString
context = 99999
}
const dd = createPatch(props.fileName, oldString, newString, '', '', { context: props.context })
const dd = createPatch(props.fileName, oldString, newString, '', '', { context: context })
return d2h.html(dd, {
outputFormat: props.outputFormat,
drawFileList: props.drawFileList,
Expand Down

0 comments on commit dccefa8

Please sign in to comment.