Skip to content

Commit cf686f6

Browse files
committed
release: v0.11.2
1 parent 9997a17 commit cf686f6

File tree

8 files changed

+4957
-321
lines changed

8 files changed

+4957
-321
lines changed

__tests__/index.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { nextTick } from 'vue'
12
import { mount } from '@vue/test-utils'
23
import { expect, test } from 'vitest'
34
import JsonEditorVue from '../src/index'
@@ -6,17 +7,20 @@ test('string value in text mode', async () => {
67
const wrapper = mount(JsonEditorVue, {
78
props: {
89
mode: 'text',
9-
modelValue: 'abc',
10+
modelValue: '',
1011
},
1112
})
12-
expect(wrapper.get('.cm-activeLine').text()).toEqual('"abc"')
13+
await wrapper.setProps({ modelValue: 'abc' })
14+
expect(wrapper.vm.jsonEditor.get().json).toEqual('abc')
1315
})
1416

1517
test('string value in tree mode', async () => {
1618
const wrapper = mount(JsonEditorVue, {
1719
props: {
18-
modelValue: 'abc',
20+
modelValue: null,
1921
},
2022
})
21-
expect(wrapper.get('.jse-value').text()).toEqual('abc')
23+
await wrapper.setProps({ modelValue: JSON.stringify({ a: 1 }) })
24+
await nextTick()
25+
expect(wrapper.vm.jsonEditor.get().json).toEqual(JSON.stringify({ a: 1 }))
2226
})

demo/vue2.6/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script>
22
import Vue from 'vue'
33
import VueCompositionAPI from '@vue/composition-api'
4-
import JsonEditorVue from 'json-editor-vue'
4+
import JsonEditorVue from '../../src'
55
66
Vue.use(VueCompositionAPI)
77

demo/vue2.7/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup>
22
import { onMounted, reactive, ref, version } from 'vue'
3-
import JsonEditorVue from 'json-editor-vue'
3+
import JsonEditorVue from '../../src'
44
55
const data = reactive({
66
value: {

demo/vue3/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script setup lang="ts">
22
import { onMounted, reactive, ref, version } from 'vue'
33
import { parse, stringify } from 'lossless-json'
4-
import JsonEditorVue from 'json-editor-vue'
5-
import type { Mode } from 'json-editor-vue'
4+
import type { Mode } from '../../src'
5+
import JsonEditorVue from '../../src'
66
77
const console = window.console
88
@@ -36,7 +36,7 @@ const data = reactive<{
3636
c: 'd',
3737
},
3838
},
39-
mode: undefined,
39+
mode: 'text',
4040
readOnly: false,
4141
parser: LosslessJSONParser,
4242
})

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "json-editor-vue",
33
"PascalCasedName": "JsonEditorVue",
4-
"version": "0.11.1",
4+
"version": "0.11.2",
55
"private": false,
66
"description": "Vue 2.6/2.7/3 & Nuxt 2/3 isomorphic JSON editor, viewer, formatter and validator.",
77
"author": {
@@ -56,10 +56,10 @@
5656
"scripts": {
5757
"dev": "esno ./scripts/dev.mts",
5858
"up": "nu -L !@antfu/eslint-config && ni",
59-
"doc": "vitepress dev --open /README",
60-
"build": "vite build",
6159
"test-unit": "vitest run",
6260
"coverage": "vitest run --coverage",
61+
"doc": "vitepress dev --open /README",
62+
"build": "vite build",
6363
"release": "esno ./scripts/release.mts",
6464
"pnpm:devPreinstall": "node ./scripts/devPreinstall.js",
6565
"preinstall": "node -e \"if (process.env.INIT_CWD === process.cwd()) { process.exit(1) }\" || npx only-allow pnpm",
@@ -127,6 +127,6 @@
127127
"lint-staged": {
128128
"*.md": "case-police --fix",
129129
"docs/README.zh-CN.md": "zhlint --fix",
130-
"*": "eslint --cache --ignore-pattern 'demo/' --fix"
130+
"{scripts,src}": "eslint --cache --fix"
131131
}
132132
}

0 commit comments

Comments
 (0)