Skip to content

Commit d68ee89

Browse files
committed
fix: boolean attrs not working in CDN usage
1 parent 31d0812 commit d68ee89

File tree

4 files changed

+233
-340
lines changed

4 files changed

+233
-340
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,17 @@ export default {
259259
| ------- | --------------------------------------------------------------------------------------------- | ------------------ | -------- |
260260
| v-model | binding value | `any` | |
261261
| mode | edit mode, use `v-model:mode` in Vue 3 or `:mode.sync` in Vue 2 | `'tree'`, `'text'` | `'tree'` |
262-
| ... | properties of [svelte-jsoneditor](https://github.com/josdejong/svelte-jsoneditor/#properties) (via attrs) | | |
262+
| ... | properties of [svelte-jsoneditor](https://github.com/josdejong/svelte-jsoneditor/#properties) | | |
263263

264-
### Boolean Attrs
264+
Boolean properties of `svelte-jsoneditor` like `readOnly` will imply `true`:
265265

266-
Boolean properties of `svelte-jsoneditor` like `readOnly` won't imply `true` because they are [attrs](https://vuejs.org/guide/components/attrs.html):
266+
- ✔️ `<JsonEditorVue readOnly />`
267267

268268
- ✔️ `<JsonEditorVue :readOnly="true" />`
269269

270-
-`<JsonEditorVue readOnly />`
270+
-`use(JsonEditorVue, { readOnly: '' })`
271+
272+
- ✔️ `use(JsonEditorVue, { readOnly: true })`
271273

272274
<br>
273275

docs/README.zh-CN.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,15 @@ export default {
259259
| mode | 编辑模式,在 Vue 3 中使用 `v-model:mode`,在 Vue 2 中使用 `:mode.sync` | `'tree'`, `'text'` | `'tree'` |
260260
| ... | [svelte-jsoneditor](https://github.com/josdejong/svelte-jsoneditor/#properties) 的参数(通过 attrs) | | |
261261

262-
### 布尔类型的 Attrs
262+
`svelte-jsoneditor` 的布尔类型参数如 `readOnly` 支持隐式转换为 `true`
263263

264-
`svelte-jsoneditor` 的布尔类型参数如 `readOnly` 不会隐式转换为 `true`,因为它们是 [attrs](https://vuejs.org/guide/components/attrs.html):
264+
- ✔️ `<JsonEditorVue readOnly />`
265265

266266
- ✔️ `<JsonEditorVue :readOnly="true" />`
267267

268-
-`<JsonEditorVue readOnly />`
268+
-`use(JsonEditorVue, { readOnly: '' })`
269+
270+
- ✔️ `use(JsonEditorVue, { readOnly: true })`
269271

270272
<br>
271273

0 commit comments

Comments
 (0)