publication v-1
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
{{ props.props?.categories[0].name }}
|
||||
</p>
|
||||
<div
|
||||
v-html="describe"
|
||||
class="descriptios hidden md:block w-[39.896vw] text-[1.055vw] leading-[1.582vw] mt-[1.2vw]"
|
||||
></div>
|
||||
<p
|
||||
@@ -199,18 +200,16 @@
|
||||
const props = defineProps(["props"]);
|
||||
import {jDate} from "@/utils/jDate"
|
||||
|
||||
if (process.client) {
|
||||
const des = props?.props.description;
|
||||
function hideEndOfString(inputString) {
|
||||
const words = inputString.split(" ");
|
||||
if (words.length > 50) {
|
||||
const truncatedWords = words.slice(0, 50);
|
||||
return truncatedWords.join(" ") + "...";
|
||||
} else {
|
||||
return inputString;
|
||||
|
||||
function hideEndOfString(inputString) {
|
||||
const words = inputString.split(" ");
|
||||
if (words.length > 50) {
|
||||
const truncatedWords = words.slice(0, 30);
|
||||
return truncatedWords.join(" ") + "...";
|
||||
} else {
|
||||
return inputString;
|
||||
}
|
||||
}
|
||||
}
|
||||
const data = hideEndOfString(des);
|
||||
document.querySelector(".descriptios").innerHTML = data;
|
||||
}
|
||||
const describe = hideEndOfString(props.props.description);
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user