v-code-diff 1.13.1 → 1.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -5
- package/dist/v2/{index.cjs.js → index.cjs} +17 -17
- package/dist/v2/index.es.js +1119 -1097
- package/dist/v2/index.umd.js +17 -17
- package/dist/v2.7/{index.cjs.js → index.cjs} +14 -14
- package/dist/v2.7/index.es.js +625 -613
- package/dist/v2.7/index.umd.js +13 -13
- package/dist/v3/{index.cjs.js → index.cjs} +14 -14
- package/dist/v3/index.es.js +860 -840
- package/dist/v3/index.umd.js +15 -15
- package/package.json +21 -13
- package/scripts/perf-test.ts +40 -0
- package/scripts/postinstall.cjs +15 -18
- package/scripts/utils.cjs +4 -19
- package/src/CodeDiff.vue +7 -5
- package/src/split/SplitLine.vue +9 -5
- package/src/unified/UnifiedLine.vue +1 -1
- package/src/utils.ts +17 -0
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
> A code diff display plugin, available for Vue2 / Vue3.
|
|
8
8
|
|
|
9
9
|
<p align='center'>
|
|
10
|
-
<b>English</b> | <a href="https://github.com/Shimada666/v-code-diff/blob/
|
|
10
|
+
<b>English</b> | <a href="https://github.com/Shimada666/v-code-diff/blob/main/README-zh.md">简体中文</a>
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
Old Version:
|
|
@@ -47,6 +47,19 @@ yarn add v-code-diff
|
|
|
47
47
|
pnpm add v-code-diff
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
Use the explicit entry for your Vue version. These entries do not depend on
|
|
51
|
+
`postinstall`, so they also work when the package manager blocks dependency
|
|
52
|
+
scripts:
|
|
53
|
+
|
|
54
|
+
| Vue version | Import path |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| Vue 2.6 | `v-code-diff/vue2` |
|
|
57
|
+
| Vue 2.7 | `v-code-diff/vue2.7` |
|
|
58
|
+
| Vue 3 | `v-code-diff/vue3` |
|
|
59
|
+
|
|
60
|
+
The legacy `v-code-diff` root entry remains available when dependency scripts
|
|
61
|
+
are enabled.
|
|
62
|
+
|
|
50
63
|
Vue2.6 developers need install composition-api
|
|
51
64
|
|
|
52
65
|
```shell
|
|
@@ -61,7 +74,7 @@ pnpm add @vue/composition-api
|
|
|
61
74
|
> Recommend using local registration for better tree-shaking support.
|
|
62
75
|
```vue
|
|
63
76
|
<script setup>
|
|
64
|
-
import { CodeDiff } from 'v-code-diff'
|
|
77
|
+
import { CodeDiff } from 'v-code-diff/vue3'
|
|
65
78
|
</script>
|
|
66
79
|
|
|
67
80
|
<template>
|
|
@@ -79,7 +92,7 @@ import { CodeDiff } from 'v-code-diff'
|
|
|
79
92
|
|
|
80
93
|
```ts
|
|
81
94
|
import { createApp } from 'vue'
|
|
82
|
-
import CodeDiff from 'v-code-diff'
|
|
95
|
+
import CodeDiff from 'v-code-diff/vue3'
|
|
83
96
|
|
|
84
97
|
app
|
|
85
98
|
.use(CodeDiff)
|
|
@@ -104,7 +117,8 @@ then
|
|
|
104
117
|
> Recommend using local registration for better tree-shaking support.
|
|
105
118
|
```vue
|
|
106
119
|
<script>
|
|
107
|
-
|
|
120
|
+
// Use v-code-diff/vue2.7 instead when running Vue 2.7.
|
|
121
|
+
import { CodeDiff } from 'v-code-diff/vue2'
|
|
108
122
|
export default {
|
|
109
123
|
components: {
|
|
110
124
|
CodeDiff
|
|
@@ -125,7 +139,8 @@ export default {
|
|
|
125
139
|
#### Register globally
|
|
126
140
|
```ts
|
|
127
141
|
import Vue from 'vue'
|
|
128
|
-
|
|
142
|
+
// Use v-code-diff/vue2.7 instead when running Vue 2.7.
|
|
143
|
+
import CodeDiff from 'v-code-diff/vue2'
|
|
129
144
|
|
|
130
145
|
Vue.use(CodeDiff)
|
|
131
146
|
```
|