api-client/components/firebase/inputform.vue

56 lines
992 B
Vue
Raw Normal View History

2020-01-20 16:55:48 +00:00
<template>
2020-01-22 01:57:38 +00:00
<div>
<ul>
<li>
<input
:aria-label="$t('label')"
type="text"
autofocus
v-model="message"
:placeholder="$t('paste_a_collection')"
/>
</li>
</ul>
<ul>
<li>
<input
:aria-label="$t('label')"
type="text"
autofocus
v-model="label"
:placeholder="$t('label')"
/>
</li>
<button
class="icon"
:disabled="!(this.message && this.label)"
value="Save"
@click="formPost"
>
<i class="material-icons">add</i>
<span>Add</span>
</button>
</ul>
</div>
2020-01-20 16:55:48 +00:00
</template>
<script>
2020-01-21 12:25:35 +00:00
import { fb } from "../../functions/fb";
2020-01-20 16:55:48 +00:00
export default {
data() {
return {
2020-01-22 01:57:38 +00:00
message: null,
label: null
2020-01-20 16:55:48 +00:00
};
},
methods: {
formPost() {
2020-01-23 13:37:36 +00:00
fb.writeFeeds(this.message, this.label);
2020-01-20 16:55:48 +00:00
this.message = null;
2020-01-22 01:57:38 +00:00
this.label = null;
2020-01-20 16:55:48 +00:00
}
}
};
</script>