wwf
13 小时以前 a1d7e81859f554f3a53680cc35f0f49bf1f77098
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { JSONEditorOptions, JSONEditorMode } from 'jsoneditor'
 
export interface JsonEditorProps {
  /**
   * JSON数据,支持双向绑定
   */
  modelValue: any
  
  /**
   * 编辑器模式
   * @default 'tree'
   */
  mode?: JSONEditorMode
  
  /**
   * 编辑器高度
   * @default '400px'
   */
  height?: string
  
  /**
   * 是否显示模式选择下拉菜单
   * @default false
   */
  showModeSelection?: boolean
  
  /**
   * 是否显示导航栏
   * @default false
   */
  showNavigationBar?: boolean
  
  /**
   * 是否显示状态栏
   * @default true
   */
  showStatusBar?: boolean
  
  /**
   * 是否显示主菜单栏
   * @default true
   */
  showMainMenuBar?: boolean
  
  /**
   * JSONEditor配置选项
   * @see https://github.com/josdejong/jsoneditor/blob/develop/docs/api.md
   */
  options?: Partial<JSONEditorOptions>
}
 
/**
 * JsonEditor组件触发的事件
 */
export interface JsonEditorEmits {
  /**
   * 数据更新时触发
   */
  (e: 'update:modelValue', value: any): void
  
  /**
   * 数据变化时触发
   */
  (e: 'change', value: any): void
  
  /**
   * 验证错误时触发
   */
  (e: 'error', errors: any): void
}
 
/**
 * JsonEditor组件暴露的方法
 */
export interface JsonEditorExpose {
  /**
   * 获取原始的JSONEditor实例
   */
  getEditor: () => any