Answer the question
In order to leave comments, you need to log in
How to replace usernames with layout when rendering array elements in Vue?
Hello, how can I render a list of comments only if it contains, for example, users with the @ symbol so that they can be rendered (I want to highlight) in the layout instead of plain text?
For example, if regular comments are rendered as , and if there are users, then they should be rendered as:<div> lorem ipsum </div>,
<div> lorem ipsum <span>@name</span> set nomini </div>
? Similar functionality is on github, for example, in discussions. <div
v-for="item in comments"
:key="item.id"
class="comment-item"
>
...
<span class="comment-text"> {{ item.text }} </span>
</div>
Answer the question
In order to leave comments, you need to log in
.highlight {
color: white;
background: red;
}
methods: {
highlightNames: str => str.replace(/(?<=^|\s)@\S+/g, '<span class="highlight">$&</span>'),
},
<div v-html="highlightNames(item.text)"></div>
Not that it's a program, on OS X you can take several types of screenshots out of the box.
Command + Shift + 3: весь экран в файл на рабочем столе
Command + Shift + 4: выделенная область в файл
Command + Shift + 4 + пробел: окно программы в файл
Вопрос такой: это какая-то особая программа на OS X для снятия скриншотов,
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question