mirror of
https://github.com/tenrok/vue-json-viewer.git
synced 2026-06-05 16:42:30 +03:00
32 lines
712 B
Vue
32 lines
712 B
Vue
<template>
|
|
<span>
|
|
<j-icon v-if="!keyName" :type="value ? 'arrow-down-b' : 'arrow-up-b'" @click.stop="toggle"></j-icon>
|
|
<span>[</span>
|
|
<template v-if="jsonValue.length">
|
|
<json-box v-show="value" v-for="(val, index) in jsonValue" :key="index" :value="val"></json-box>
|
|
<span v-show="!value" class="node-ellipsis">...</span>
|
|
</template>
|
|
<span>]</span>
|
|
</span>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'JsonArray',
|
|
props: {
|
|
jsonValue: Array,
|
|
keyName: String,
|
|
value: Boolean
|
|
},
|
|
methods: {
|
|
toggle() {
|
|
this.$emit('input', !this.value);
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style>
|
|
|
|
</style>
|