Answer the question
In order to leave comments, you need to log in
How to dynamically change content in Material Vue Modal?
There is a list of messages that I output via v-for. Initially, I see a preview of the message, i.e. not the full text, but to see the full text I have to click on the corresponding message, a modal pops up with all the details.
The crux of the question is how to display the relevant content in the modal window?
Message output:
<div v-for="message in messagesList"
:key="message.msgFrom"
:class="`message-row d-flex ${message.msgNew}`"
@click="showMessageModal = true">
<div class="message-date">
<span class="day">{{ message.day }}</span>
<span class="month">{{ message.month }}</span>
</div>
<div class="message-content">
<span class="message-from">Message from {{ message.msgFrom }}</span>
<p class="message-txt">{{ message.msgText }}</p>
</div>
</div>
<md-dialog :md-active.sync="showMessageModal">
<div class="box-wrapper">
<div class="box-header">
<div class="box-header-left">
<span class="box-title">Message from {{ Здесь нужно выводить соответствующее имя }}</span>
</div>
<div class="box-header-right">
<div class="icon-wrap" @click="showMessageModal = false">
<Icon name="close" fontSize="23px" color="#fff" />
</div>
</div>
</div>
<div class="box-body">
{{ А здесь выводить полное сообщение }}
</div>
</div>
</md-dialog>
Answer the question
In order to leave comments, you need to log in
Add a property to the component that will be a link to the message clicked by the user, and update it when the window opens:
@click="openModal(message)"
data: () => ({
openedMessage: {},
...
}),
methods: {
openModal(message) {
this.openedMessage = message;
this.showMessageModal = true;
},
...
},
<span class="box-title">{{ openedMessage.какоеТамУВасСвойствоОтвечаетЗаЭтотTitle }}</span>
...
<div class="box-body">{{ openedMessage.нуТутТожеВамВиднееЧтоНаписать }}</div>
$price = str_replace(array(" ", chr(0xC2).chr(0xA0)), '', $price);
it is displayed as
but in fact it may have some kind of character code, the string encoding may be different.
For example, here is the article "An interesting nuance with spaces when cleaning texts with the preg_replace function"
https://ph0en1x.net/17-interesnyj-nyuans-s-probela...
he uses a hex editor, I think there are easier solutions) some kind of online detector, character parser, such as display all characters with codes
str_replace(chr(160), ' ', html_entity_decode($arFields['NAME']))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question