Skip to content

Instantly share code, notes, and snippets.

@nparsons08 nparsons08/14.js Secret
Created May 28, 2019

Embed
What would you like to do?
// src/App.vue
<h2 class="uk-text-center">Chats</h2>
<div class="uk-panel uk-panel-scrollable">
<ul class="uk-list uk-list-divider">
<li v-for="message in messages" :key="message.id">
<div
:class="{ 'uk-text-right': message.user.id === user.username }"
>{{ message.text }}</div>
</li>
</ul>
</div>
<form @submit.prevent="sendMessage" method="post">
<div class="uk-flex uk-margin-small-top">
<div class="uk-width-expand">
<input
class="uk-input"
type="text"
v-model="newMessage"
placeholder="Start chatting..."
>
</div>
<div class="uk-width-auto">
<button class="uk-button uk-button-primary">Send</button>
</div>
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.