| created() { |
| if (!this.category) { |
| this.$store.dispatch('categoryBySlug', this.$route.params['slug']); |
| } |
| |
| if (!this.products) { |
| this.$store.dispatch('allProductsById', this.category.id); |
| } |
| |
| |
| console.log(this.category); |
| |
| |
| |
| |
| document.title = this.$router.currentRoute.meta.title; |
| |
| }, |
| methods: { |
| |
| getPrice (name) { |
| let slider = this.$refs[name]; |
| }, |
| }, |
| |
| computed: { |
| |
| test() { |
| return this.category.id; |
| }, |
| |
| category () { |
| return this.$store.getters.categoryBySlug(this.$route.params['slug']); |
| }, |
| |
| products () { |
| return this.$store.getters.allProductsById(1); |
| }, |
| |
| filteredProducts: function() { |
| return this.products.filter(product => { |
| return product.title.toLowerCase().includes(this.filters.title.toLowerCase()) |
| }) |
| }, |
| |
| } |