mirror of
https://github.com/nexus-stc/hyperboria
synced 2024-12-05 01:12:55 +01:00
d51e5ab65d
- fix: Translation fixes - fix: Various fixes - feat: PB translations, configuration changes - fix: Bugfixes GitOrigin-RevId: 55f8b148c42a296162fc707c36a5146ca0073b4b
63 lines
1.0 KiB
Vue
63 lines
1.0 KiB
Vue
<template lang="pug">
|
|
tr(v-if="value")
|
|
th {{label}}
|
|
td(:class="valueClasses")
|
|
| {{formattedValue}}
|
|
cite
|
|
a(href="javascript:void(null);" @click="showMore" v-if="collapseText") show more...
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'VTr',
|
|
|
|
props: {
|
|
label: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
valueClasses: {
|
|
type: String,
|
|
required: false
|
|
},
|
|
value: {
|
|
required: true,
|
|
default: null
|
|
},
|
|
maxLength: {
|
|
type: Number,
|
|
default: 300
|
|
}
|
|
},
|
|
data () {
|
|
return {
|
|
showAll: false
|
|
}
|
|
},
|
|
computed: {
|
|
collapseText () {
|
|
return this.value.length > this.maxLength && !this.showAll
|
|
},
|
|
formattedValue () {
|
|
if (this.value) {
|
|
if (this.collapseText) {
|
|
return this.value.substr(0, this.maxLength)
|
|
} else {
|
|
return this.value
|
|
}
|
|
}
|
|
return null
|
|
}
|
|
},
|
|
methods: {
|
|
showMore () {
|
|
this.showAll = true
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
|
|
</style>
|