2
0
mirror of https://github.com/tenrok/vue-json-viewer.git synced 2026-06-08 17:22:32 +03:00
Files
vue-json-viewer/types/json-array.vue
T
陈峰 c09807c798 init
2017-10-18 11:45:31 +08:00

32 lines
732 B
Vue

<template>
<span>
<i v-if="!keyName" class="icon" :class="{'ion-arrow-down-b': value, 'ion-arrow-up-b': !value}" @click.stop="toggle"></i>
<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>