Skip to content

Commit 632324a

Browse files
committed
docs: formatting
1 parent 95f4956 commit 632324a

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ import { ref } from 'vue'
541541
542542
const JsonEditorVue = () => process.client
543543
? import('json-editor-vue')
544-
: Promise.resolve({ render: h => h('div') })
544+
: Promise.resolve({ render: (h) => h('div') })
545545
546546
const value = ref()
547547
</script>
@@ -638,7 +638,7 @@ export default {
638638
components: {
639639
JsonEditorVue: () => process.client
640640
? import('json-editor-vue')
641-
: Promise.resolve({ render: h => h('div') }),
641+
: Promise.resolve({ render: (h) => h('div') }),
642642
},
643643
data() {
644644
return {
@@ -828,13 +828,13 @@ module.exports = {
828828

829829
## Props
830830

831-
| Name | Description | Type | Default |
832-
| ------- | --------------------------------------------------------------------------------------------- | ------------- | -------- |
833-
| v-model | binding value | `any` | |
834-
| mode | edit mode, <br>use `[v-model]:mode` in Vue 3 <br>or `:mode[.sync]` in Vue 2 | [Mode](#Mode) | `'tree'` |
835-
| ... | properties of [svelte-jsoneditor](https://github.com/josdejong/svelte-jsoneditor/#properties) | | |
831+
| Name | Description | Type | Default |
832+
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------- | ------------- | -------- |
833+
| v-model /<br>modelValue (Vue 3) /<br>value (Vue 2) | binding value | any | |
834+
| mode /<br>v-model:mode (Vue 3) /<br>:mode.sync (Vue 2) | edit mode | [Mode](#Mode) | `'tree'` |
835+
| ... | properties of [svelte-jsoneditor](https://github.com/josdejong/svelte-jsoneditor/#properties) | | |
836836

837-
> ⚠ kebab-case is required for tag & prop name when using from CDN
837+
> ⚠ kebab-case is required for tag & prop name when using from CDN.
838838
839839
### Binding value difference between svelte-jsoneditor and json-editor-vue
840840

@@ -846,7 +846,7 @@ If you prefer the behavior of svelte-jsoneditor:
846846
```html
847847
<JsonEditorVue
848848
:content="content"
849-
:onChange="updatedContent => {
849+
:onChange="(updatedContent) => {
850850
content = updatedContent
851851
}"
852852
/>

docs/README.zh-CN.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ import { ref } from 'vue'
541541
542542
const JsonEditorVue = () => process.client
543543
? import('json-editor-vue')
544-
: Promise.resolve({ render: h => h('div') })
544+
: Promise.resolve({ render: (h) => h('div') })
545545
546546
const value = ref()
547547
</script>
@@ -638,7 +638,7 @@ export default {
638638
components: {
639639
JsonEditorVue: () => process.client
640640
? import('json-editor-vue')
641-
: Promise.resolve({ render: h => h('div') }),
641+
: Promise.resolve({ render: (h) => h('div') }),
642642
},
643643
data() {
644644
return {
@@ -828,11 +828,11 @@ module.exports = {
828828

829829
## 属性
830830

831-
| 名称 | 说明 | 类型 | 默认值 |
832-
| ------- | -------------------------------------------------------------------------------------- | ------------- | -------- |
833-
| v-model | 绑定值 | `any` | |
834-
| mode | 编辑模式,<br>在 Vue 3 中使用 `[v-model]:mode`<br>Vue 2 中使用 `:mode[.sync]` | [Mode](#Mode) | `'tree'` |
835-
| ... | [svelte-jsoneditor](https://github.com/josdejong/svelte-jsoneditor/#properties) 的参数 | | |
831+
| 名称 | 说明 | 类型 | 默认值 |
832+
| ------------------------------------------------------ | -------------------------------------------------------------------------------------- | ------------- | -------- |
833+
| v-model /<br>modelValue (Vue 3) /<br>value (Vue 2) | 绑定值 | any | |
834+
| mode /<br>v-model:mode (Vue 3) /<br>:mode.sync (Vue 2) | 编辑模式 | [Mode](#Mode) | `'tree'` |
835+
| ... | [svelte-jsoneditor](https://github.com/josdejong/svelte-jsoneditor/#properties) 的属性 | | |
836836

837837
### svelte-jsoneditor 与 json-editor-vue 中绑定值的差异
838838

@@ -844,23 +844,23 @@ module.exports = {
844844
```html
845845
<JsonEditorVue
846846
:content="content"
847-
:onChange="updatedContent => {
847+
:onChange="(updatedContent) => {
848848
content = updatedContent
849849
}"
850850
/>
851851
```
852852

853853
> 详情见 https://github.com/josdejong/svelte-jsoneditor/pull/166。
854854
855-
### 布尔类型参数
855+
### 布尔类型属性
856856

857-
仅写上 svelte-jsoneditor 的布尔类型参数如 `readOnly` 但不传值,会隐式转换为 `true`
857+
仅写上 svelte-jsoneditor 的布尔类型属性如 `readOnly` 但不传值,会隐式转换为 `true`
858858

859859
- ✔️ `<JsonEditorVue readOnly />`
860860

861861
- ✔️ `<JsonEditorVue :readOnly="true" />`
862862

863-
> 通过 CDN 使用时,标签、prop 名称都必须使用短横线命名
863+
> 通过 CDN 使用时,标签、属性名称都必须使用短横线命名。
864864
865865
<br>
866866

0 commit comments

Comments
 (0)