Gathering detailed insights and metrics for @qingbing/ts-v3-json-editor
Gathering detailed insights and metrics for @qingbing/ts-v3-json-editor
Gathering detailed insights and metrics for @qingbing/ts-v3-json-editor
Gathering detailed insights and metrics for @qingbing/ts-v3-json-editor
npm install @qingbing/ts-v3-json-editor
Typescript
Module System
Node Version
NPM Version
42.9
Supply Chain
95.4
Quality
74.2
Maintenance
100
Vulnerability
98.2
License
Total Downloads
540
Last Day
1
Last Week
3
Last Month
19
Last Year
516
Minified
Minified + Gzipped
Latest Version
2.1.8
Package Id
@qingbing/ts-v3-json-editor@2.1.8
Unpacked Size
13.94 kB
Size
5.19 kB
File Count
7
NPM Version
9.6.4
Node Version
20.0.0
Published on
Apr 07, 2024
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
200%
3
Compared to previous week
Last Month
-74.7%
19
Compared to previous month
Last Year
2,050%
516
Compared to previous year
https://gitee.com/duqingbing/ts-v3-package/tree/ts-v3-json-editor
vite + ts + vue3 封装的 JsonEditor 插件
1# yarn 安装 2yarn add @qingbing/ts-v3-json-editor 3 4# npm 安装 5npm i @qingbing/ts-v3-json-editor
属性名 | 类型 | 是否必需 | 默认值 | 意义 |
---|---|---|---|---|
options | TJsonEditorOptions | 否 | {} | JsonEditor 的绑定参数, 参考 vue3-ts-jsoneditor 的绑定参数 |
modelValue | {jsonable} | 否 | "" | JsonEditor 编辑的 json 数据, 值为任意可 json 化的内容 |
disabledFullScreen | Boolean | 否 | false | 控制是否显示全屏按钮 |
1// vue3-ts-jsoneditor 插件的参数可以直接透传 2type Mode = "text" | "tree" | "table"; 3interface JSONEditorOptions { 4 readOnly?: boolean; 5 indentation?: number | string; 6 tabSize?: number; 7 selection?: JSONEditorSelection; 8 mode?: Mode; 9 mainMenuBar?: boolean; 10 navigationBar?: boolean; 11 statusBar?: boolean; 12 askToFormat?: boolean; 13 escapeControlCharacters?: boolean; 14 escapeUnicodeCharacters?: boolean; 15 flattenColumns?: boolean; 16 validator?: Validator; 17 parser?: JSONParser; 18 validationParser?: JSONParser; 19 pathParser?: JSONPathParser; 20 queryLanguagesIds?: QueryLanguageId[]; 21 queryLanguageId?: QueryLanguageId; 22 onRenderValue?: OnRenderValue; 23 onClassName?: OnClassName; 24 onRenderMenu?: OnRenderMenu; 25 height?: string | number; 26 fullWidthButton?: boolean; 27 darkTheme?: boolean; 28}
属性名 | 类型 |
---|---|
- | 无 |
JsonEditor
作为组件全局通用1// main.ts 2import '@qingbing/ts-v3-json-editor/dist/style.css' 3import { JsonEditorPlugin } from '@qingbing/ts-v3-json-editor' 4app.use(JsonEditorPlugin, { 5 name: 'JsonEditor', 6 options: {} 7})
1<template> 2 <h1>Parent: {{ record }}</h1> 3 <JsonEditor :options="options" v-model="record.data" /> 4 <JsonEditor :options="options2" v-model="record.data2" :disabled-fullscreen="disabledFullscreen" /> 5</template> 6 7<script setup lang="ts"> 8import '@qingbing/ts-v3-json-editor/dist/style.css' 9import type { TJsonEditorOptions } from "@qingbing/ts-v3-json-editor"; 10import { JsonEditor } from '@qingbing/ts-v3-json-editor' // 如果注册成了全局组件,这句将不再需要 11import { reactive } from "vue"; 12 13const record = reactive({ 14 data: { 15 array: [1, 2, 3], 16 boolean: true, 17 Null: null, 18 number: 123, 19 seconds: 0, 20 object: { a: "b", c: "d" }, 21 string: "Hello World", 22 }, 23 data2: { 24 array: [1, 2, 3] 25 }, 26}); 27 28const options: TJsonEditorOptions = { 29 height: 500, 30 mode: "text", 31}; 32const options2: TJsonEditorOptions = { 33 height: 400, 34 mode: "text", 35}; 36const disabledFullscreen = ref(true) 37</script>
No vulnerabilities found.
No security vulnerabilities found.