change adress and edit blog item

This commit is contained in:
mohadese-nm
2024-07-24 15:54:28 +04:30
parent e355bdc3e2
commit 33b3ef06ab
2 changed files with 23 additions and 13 deletions
+21 -10
View File
@@ -3,8 +3,10 @@
<article>
<img :src="coverImage" :alt="title" />
<div>
<h1>{{ title }}</h1>
<div v-if="type != 'vertical'" v-html="content" />
<h3>{{ removeTags(title) }}</h3>
<div v-if="type != 'vertical'">
<p>{{ removeTags(content) }}</p>
</div>
<Button v-if="type == 'normal'" v-bind="btn.props" />
</div>
</article>
@@ -19,6 +21,11 @@ const props = defineProps({
type: { default: 'normal' },
data: {},
});
const removeTags = (str) => {
if (str === null || str === '') return false
else str = str.toString()
return str.replace(/(<([^>]+)>|&nbsp;)+/gi, '')
}
const { link, coverImage, title, content } = props.data
</script>
@@ -35,12 +42,16 @@ const { link, coverImage, title, content } = props.data
&>div {
@apply flex flex-col overflow-hidden font-vazir;
h1 {
@apply text-zinc-800 font-bold truncate;
h3 {
@apply text-zinc-800 font-bold truncate h-8;
}
p {
@apply text-zinc-500 lg:leading-[1.9rem];
overflow: hidden !important;
display: -webkit-box !important;
-webkit-box-orient: vertical !important;
-webkit-line-clamp: 3 !important;
}
}
}
@@ -48,7 +59,7 @@ const { link, coverImage, title, content } = props.data
.post-item-normal {
article {
@apply w-[21.4rem] h-[4.7rem];
@apply w-[21.4rem] min-h-[4.7rem];
@apply lg:w-[55.9rem] lg:h-[11.9rem];
img {
@@ -59,8 +70,8 @@ const { link, coverImage, title, content } = props.data
@apply flex flex-col justify-between lg:justify-center;
@apply gap-1 lg:gap-6;
h1 {
@apply text-xs lg:text-2xl whitespace-normal;
h3 {
@apply text-xs lg:text-xl whitespace-normal h-8;
}
p {
@@ -68,7 +79,7 @@ const { link, coverImage, title, content } = props.data
}
button {
@apply w-max h-max text-[#43E97B] py-1.5 px-3.5 -mr-3.5 -my-1.5 #{!important};
@apply w-max h-max text-[#4D88B7] py-1.5 px-3.5 -mr-3.5 -my-1.5 #{!important};
.p-button-label {
@apply font-normal font-vazir text-[0.7em] lg:text-base;
@@ -93,7 +104,7 @@ const { link, coverImage, title, content } = props.data
&>div {
@apply gap-2 lg:gap-0.5 justify-center;
h1 {
h3 {
@apply text-xs lg:text-base lg:leading-[2.8rem];
}
@@ -116,7 +127,7 @@ const { link, coverImage, title, content } = props.data
@apply w-full h-[9.9rem] lg:h-[18.3rem] object-cover;
}
&>div h1 {
&>div h3 {
@apply text-xs lg:text-base leading-6 line-clamp-3 lg:line-clamp-2 whitespace-break-spaces;
}
}