javascript - Vue2 render showing symbols at the begining -
i working on project uses laravel 5.4 & vue2 (laravel socialite) render messages pusher. trying fix several "bugs" , here 1 not able fix yet:
i have function on vue element:
showchatbox : function(conversation) { indexes = $.map(this.chatboxes, function(thread, key) { if(thread.id == conversation.id) { return key; } }); if(indexes[0] >= 0) { console.log('prevented second opening of chat box'); } else{ this.$http.post(base_url + 'data/' + conversation.id).then( function(response) { if(response.status) { var chatbox = json.parse(response.body).data; chatbox.newmessage = ""; chatbox.user = conversation.user; chatbox.minimised = false; this.chatboxes.push(chatbox); vm = this; settimeout(function(){ vm.autoscroll('.chat-conversation'); },100) } }); } },
i tried "debug" chatboxes element with: console.log(vm.chatboxes[0].conversationmessages.data[5].body);
and vue tools firefox , see message (for example):
how you?
the original way render on html:
<div class="chat-box" v-bind:class="[chatbox.minimised ? 'chat-box-small' : '', ]" v-for="chatbox in chatboxes"> <!-- chats boxes --> <div class="chat-box-header"> <span class="side-left"> <a href="@{{ chatbox.user.username }}" target="_blank">@{{ chatbox.user.name }}</a> </span> <ul class="list-inline side-right"> <li class="minimize-chatbox"><a href="#"><i class="fa fa-minus" @click.prevent="chatbox.minimised ? chatbox.minimised=false : chatbox.minimised=true" aria-hidden="true"></i></a></li> <li class="close-chatbox"><a href="#" @click.prevent="chatboxes.$remove(chatbox)" ><i class="fa fa-times" aria-hidden="true"></i></a></li> </ul> </div> <div class="chat-conversation scrollable smooth-scroll"> <ul class="list-unstyled chat-conversation-list"> <li class="message-conversation" v-bind:class="[({{ auth::id() }}==message.user.id) ? 'current-user' : '', ]" v-for="message in chatbox.conversationmessages.data"> <div class="media"> <div class="media-left"> <a href="#"> <img v-bind:src="message.user.avatar" alt="images"> </a> </div> <div class="media-body "> <p class="post-text"> @{{ message.body }} <- important line </p> </div> </div> </li> </ul> </div> <div class="message-input"> <fieldset class="form-group"> <input class="form-control" v-model="chatbox.newmessage" v-on:keyup.enter="postmessage(chatbox)" id="exampletextarea" > </fieldset> <!-- <ul class="list-inline">this fields hidden because in dev 1.0 dont use fuctionality ,if enable height of chat list increased <li><a href="#"><i class="fa fa-camera-retro" aria-hidden="true"></i></a></li> <li><a href="#"><i class="fa fa-smile-o" aria-hidden="true"></i></a></li> </ul> --> </div> </div>
when rendered, has symbols in wrong side:
?how you
i tried render <p v-html="message.body"></p>
looks same. should do?
thanks in advance.
Comments
Post a Comment