diff options
author | Adam T. Carpenter <atc@53hor.net> | 2020-11-12 16:27:13 -0500 |
---|---|---|
committer | Adam T. Carpenter <atc@53hor.net> | 2020-11-12 16:27:13 -0500 |
commit | 9b77f9ec2c00b48c551f65b2e9d7a087004de4c0 (patch) | |
tree | b7eb96fc4a2c7baffcb4acfc93c572ab079f11a2 /iridescence/src/components/admin/NewProduct.vue | |
parent | 7381a7033231e6454a37fd64b1f3de4e8d59355f (diff) | |
download | theglassyladies-9b77f9ec2c00b48c551f65b2e9d7a087004de4c0.tar.xz theglassyladies-9b77f9ec2c00b48c551f65b2e9d7a087004de4c0.zip |
Noice. Product creation and updating is totally functional.
Diffstat (limited to 'iridescence/src/components/admin/NewProduct.vue')
-rw-r--r-- | iridescence/src/components/admin/NewProduct.vue | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/iridescence/src/components/admin/NewProduct.vue b/iridescence/src/components/admin/NewProduct.vue index 48eb165..cd8a93e 100644 --- a/iridescence/src/components/admin/NewProduct.vue +++ b/iridescence/src/components/admin/NewProduct.vue @@ -17,7 +17,7 @@ <button class="delete" @click="toggleModal"></button> </header> <section class="modal-card-body"> - <ProductEditCard v-bind:parent-product="template"></ProductEditCard> + <ProductEditCard v-bind:index="-1"></ProductEditCard> </section> <footer class="modal-card-foot"></footer> </div> @@ -27,7 +27,6 @@ </template> <script> -import Product from "@/models/product"; import ProductEditCard from "@/components/admin/ProductEditCard"; export default { @@ -37,11 +36,19 @@ export default { }, data: function() { return { - modalEnabled: false, - template: new Product({}), - addAnother: false + modalEnabled: false }; }, + computed: { + numProducts: function() { + return this.$store.getters.products.length; + } + }, + watch: { + numProducts: function() { + this.modalEnabled = false; + } + }, methods: { toggleModal() { this.modalEnabled = !this.modalEnabled; |