Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit fb2fa579
authored
Jan 02, 2026
by
MT-Joer
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style: 风格同步测试
1 parent
3d67c57e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
37 deletions
apps/playground/src/views/examples/json-viewer/index.vue
apps/playground/src/views/examples/json-viewer/index.vue
View file @
fb2fa57
<
template
>
<Page
description=
"一个渲染 JSON 结构数据的组件,支持复制、展开等,简单易用"
title=
"Json Viewer"
>
<Card
title=
"默认配置"
>
<JsonViewer
:value=
"json1"
/>
</Card>
<Card
class=
"mt-4"
title=
"可复制、默认展开3层、显示边框、事件处理"
>
<JsonViewer
boxed
copyable
:expand-depth=
"3"
:sort=
"false"
:value=
"json2"
@
copied=
"handleCopied"
@
key-click=
"handleKeyClick"
@
value-click=
"handleValueClick"
/>
</Card>
<Card
class=
"mt-4"
title=
"预览模式"
>
<JsonViewer
copyable
preview-mode
:show-array-index=
"false"
:value=
"json2"
/>
</Card>
</Page>
</
template
>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
type
{
JsonViewerAction
,
JsonViewerValue
}
from
'@vben/common-ui'
;
import
type
{
JsonViewerAction
,
JsonViewerValue
}
from
"@vben/common-ui"
;
import
{
JsonViewer
,
Page
}
from
'@vben/common-ui'
;
import
{
JsonViewer
,
Page
}
from
"@vben/common-ui"
;
import
{
Card
,
message
}
from
'ant-design-vue'
;
import
{
Card
,
message
}
from
"ant-design-vue"
;
import
{
json1
,
json2
}
from
'./data'
;
import
{
json1
,
json2
}
from
"./data"
;
function
handleKeyClick
(
key
:
string
)
{
function
handleKeyClick
(
key
:
string
)
{
message
.
info
(
`点击了Key
${
key
}
`
);
message
.
info
(
`点击了Key
${
key
}
`
);
}
}
function
handleValueClick
(
value
:
JsonViewerValue
)
{
function
handleValueClick
(
value
:
JsonViewerValue
)
{
message
.
info
(
`点击了Value
${
JSON
.
stringify
(
value
)}
`
);
message
.
info
(
`点击了Value
${
JSON
.
stringify
(
value
)}
`
);
}
}
function
handleCopied
(
_event
:
JsonViewerAction
)
{
function
handleCopied
(
_event
:
JsonViewerAction
)
{
message
.
success
(
'已复制JSON'
);
message
.
success
(
"已复制JSON"
);
}
}
</
script
>
</
script
>
<
template
>
<Page
title=
"Json Viewer"
description=
"一个渲染 JSON 结构数据的组件,支持复制、展开等,简单易用"
>
<Card
title=
"默认配置"
>
<JsonViewer
:value=
"json1"
/>
</Card>
<Card
title=
"可复制、默认展开3层、显示边框、事件处理"
class=
"mt-4"
>
<JsonViewer
:value=
"json2"
:expand-depth=
"3"
copyable
:sort=
"false"
@
key-click=
"handleKeyClick"
@
value-click=
"handleValueClick"
@
copied=
"handleCopied"
boxed
/>
</Card>
<Card
title=
"预览模式"
class=
"mt-4"
>
<JsonViewer
:value=
"json2"
copyable
preview-mode
:show-array-index=
"false"
/>
</Card>
</Page>
</
template
>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment