admin 管理员组文章数量: 1086019
2024年3月29日发(作者:css多个图片放在一排)
default: true
},
isLast: {
type: Boolean,
default: true
},
fontSize: {
type: Number,
default: 13
},
expandDepth: {
type: Number,
default: 0
},
depth: {
type: Number,
default: 0
}
},
created() {
losed = ! ? : >= Depth
this.$watch('closed', () => {
losed =
})
},
data() {
return {
innerclosed: true
}
},
methods: {
isObjectOrArray(source) {
const type = (source)
const res = type === '[object Array]' || type === '[object Object]'
return res
},
toggleClose() {
if (losed) {
losed = false
} else {
losed = true
}
}
},
computed: {
isArray() {
return () === '[object Array]'
},
length() {
return y ? : ().length
},
subfix() {
return (y ? ']' : '}') + ( ? '' : ',')
},
prefix() {
return y ? '[' : '{'
},
items() {
if (y) {
return (item => {
const isJSON = ctOrArray(item)
return {
value: isJSON ? item : ify(item),
isJSON,
key: ''
}
})
}
const json =
return (json).map(key => {
const item = json[key]
const isJSON = ctOrArray(item)
return {
value: isJSON ? item : ify(item),
isJSON,
key
}
})
}
}
}
.bgView {
background-color: #efefef;
font-family: NotoSansCJKkr;
}
.json-view {
position: relative;
display: block;
width: 100%;
height: 100%;
/* white-space: nowrap; */
padding: 0 20px;
box-sizing: border-box;
line-height: 30px;
}
.json-note {
color: #909399;
}
.json-key {
color: #333333;
}
.json-value {
color: #333333;
}
.json-item {
margin: 0;
padding-left: 20px;
}
.first-line {
padding: 0;
margin: 0;
}
.json-body {
position: relative;
padding: 0;
margin: 0;
}
.json-body .body-line {
position: absolute;
height: 100%;
width: 0;
border-left: dashed 1px #bbb;
top: 0;
left: 2px;
}
.last-line {
padding: 0;
margin: 0;
}
.angle {
position: absolute;
display: block;
cursor: pointer;
float: left;
width: 20px;
text-align: center;
left: 0;
}
.angle::after {
版权声明:本文标题:vue如何实现Json格式数据展示 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1711700131a606309.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论