<template>
...
<p class="lf-news-item__date">{{ addTimeSpan(item.date) }}</p>
...
</template>
...
methods: {
addTimeSpan(date) {
if (process.client) {
let dateArr = date.split(' ');
let span = document.createElement('span');
span.innerHTML = dateArr[1];
return `${ dateArr[0] } ${ span }`
} else {
return date;
}
}
},
...
<template>
...
<p class="lf-news-item__date">
<span> {{ item.date.split(' ')[0] }} </span>
</p>
...
</template>