123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <template>
- <li class="header-comments__item">
- <NewsLink :news="comment.news">
- <div class="header-comments-item">
- <a class="header-comments-item__link" href="javascript:void(0)">
- <div class="header-comments-item__top">
- <div class="header-comments-item__text">{{ textWithoutHtml }}</div>
- </div>
- <div class="header-comments-item__bottom">
- <div class="header-comments-item__title" v-html="comment.news.name"></div>
- <div class="header-comments-item__time">
- {{ $convertDate(comment.create) }}
- </div>
- </div></a
- >
- </div>
- </NewsLink>
- </li>
- </template>
- <script>
- export default {
- props: {
- comment: {
- type: Object,
- },
- },
- computed: {
- textWithoutHtml() {
- return this.comment.text.replaceAll(/(<([^>]+)>)/ig, '')
- }
- }
- };
- </script>
- <style lang="less">
- .header-comments-item__text {
- line-height: 16px;
- max-height: 32px;
- overflow: hidden;
- }
- </style>
|