changes in home
This commit is contained in:
@@ -12,7 +12,9 @@
|
||||
{{ data.title }}
|
||||
</router-link>
|
||||
</h1>
|
||||
<p v-html="data.content"></p>
|
||||
<p>
|
||||
{{ removeTags(data.content) }}
|
||||
</p>
|
||||
<div>
|
||||
<span>{{ new Date(data.createdAt).toLocaleDateString('fa') }}</span>
|
||||
<router-link :to="'/blog/' + data.link">
|
||||
@@ -25,6 +27,12 @@
|
||||
|
||||
<script setup>
|
||||
defineProps({ data: { type: Object, default: {} } })
|
||||
|
||||
const removeTags = (str) => {
|
||||
if (str === null || str === '') return false
|
||||
else str = str.toString()
|
||||
return str.replace(/(<([^>]+)>| )+/gi, '')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user