api-client/components/collections/addCollection.vue

63 lines
1.2 KiB
Vue
Raw Normal View History

2019-10-01 22:20:23 +00:00
<template>
2019-10-25 08:14:34 +00:00
<modal v-if="show" @close="hideModal">
<div slot="header">
<ul>
<li>
<div class="flex-wrap">
<h3 class="title">New Collection</h3>
<div>
<button class="icon" @click="hideModal">
<i class="material-icons">close</i>
</button>
2019-10-01 22:20:23 +00:00
</div>
2019-10-25 08:14:34 +00:00
</div>
</li>
</ul>
</div>
<div slot="body">
<ul>
<li>
<input type="text" v-model="name" placeholder="My New Collection" />
</li>
</ul>
2019-10-01 22:20:23 +00:00
</div>
2019-10-25 08:14:34 +00:00
<div slot="footer">
<ul>
<li>
<button class="icon" @click="addNewCollection">
<i class="material-icons">add</i>
<span>Create</span>
</button>
</li>
</ul>
</div>
</modal>
2019-10-01 22:20:23 +00:00
</template>
<script>
2019-11-02 05:32:21 +00:00
export default {
props: {
show: Boolean
},
components: {
2019-11-15 18:55:05 +00:00
modal: () => import("../../components/modal")
2019-11-02 05:32:21 +00:00
},
data() {
return {
name: undefined
};
},
methods: {
addNewCollection() {
this.$store.commit("postwoman/addNewCollection", {
name: this.$data.name
});
this.$emit("hide-modal");
2019-10-01 22:20:23 +00:00
},
2019-11-02 05:32:21 +00:00
hideModal() {
this.$emit("hide-modal");
2019-10-25 08:14:34 +00:00
}
2019-11-02 05:32:21 +00:00
}
};
2019-10-22 12:02:26 +00:00
</script>