mirror of
https://github.com/nexus-stc/hyperboria
synced 2024-12-04 17:02:53 +01:00
fff80cd4e7
- fix(nexus): Preparing configs to be published - feat(nexus): Various fixes for opening left sources - fix(nexus): Fine-tune versions 1 internal commit(s) GitOrigin-RevId: 6c834cd3f4f5f18109a159a73503700dac63b0bb
56 lines
1017 B
Vue
56 lines
1017 B
Vue
<template lang="pug">
|
|
tr(v-show="value")
|
|
th {{ label }}
|
|
td(:class="valueClasses")
|
|
| {{ formattedValue }}
|
|
cite
|
|
a(href="javascript:void(null);" @click="showMore" v-if="shouldCollapseText") show more...
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'VTr',
|
|
props: {
|
|
label: {
|
|
type: String,
|
|
required: true,
|
|
default: ''
|
|
},
|
|
valueClasses: {
|
|
type: String,
|
|
required: false,
|
|
default: ''
|
|
},
|
|
value: {
|
|
type: [String, Number]
|
|
},
|
|
maxLength: {
|
|
type: Number,
|
|
default: 300
|
|
}
|
|
},
|
|
data () {
|
|
return {
|
|
showAll: false
|
|
}
|
|
},
|
|
computed: {
|
|
shouldCollapseText () {
|
|
return this.value && this.value.length > this.maxLength && !this.showAll
|
|
},
|
|
formattedValue () {
|
|
if (this.shouldCollapseText) {
|
|
return this.value.substr(0, this.maxLength)
|
|
} else {
|
|
return this.value
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
showMore () {
|
|
this.showAll = true
|
|
}
|
|
}
|
|
}
|
|
</script>
|