Limited length of tab title

This commit is contained in:
neviyn 2018-11-16 14:53:04 +00:00
parent 8016c4163e
commit 821102f69b

View File

@ -56,7 +56,7 @@
<b-card no-body>
<b-tabs pills card vertical>
<b-tab v-for="(observation, index) in observationData" v-bind:key="index">
<p slot="title">{{ observation.date }}<br/>{{ observation.whom }} {{ observation.type }}<br/>{{ observation.observed }}</p>
<p slot="title">{{ observation.date }}<br/>{{ observation.whom }} {{ observation.type }}<br/>{{ shortenedString(observation.observed) }}</p>
<h2>{{ observation.date }}, {{ observation.whom }}<br/>{{ observation.type }}, {{ observation.observed }}</h2>
<b-row align-h="center">
<h4>Observed by:&nbsp;<span v-bind:key="index" v-for="(tutor, index) in observation.tutors"><i>{{ tutor.name }}<span v-if="index+1 < observation.tutors.length">,&nbsp;</span></i></span></h4>
@ -274,6 +274,14 @@ export default {
this.errorMessage = error.response.data;
this.$refs.errorModal.show();
});
},
shortenedString: function(data) {
if(data.len < 20){
return data;
}
else{
return data.substr(0, 20) + "...";
}
}
},
watch: {