Merge pull request #605 from jitendra-webkul/jitendra

Issue #581 fixed
This commit is contained in:
JItendra Singh 2019-02-20 14:31:31 +05:30 committed by GitHub
commit 7cae7a28b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/shop.js": "/js/shop.js?id=e25827d4b84cbe5d76fb",
"/js/shop.js": "/js/shop.js?id=391400bc9a994e60b97f",
"/css/shop.css": "/css/shop.css?id=f55c895c4bc57f6cd61b"
}

View File

@ -1,7 +1,9 @@
<template>
<li>
<a :href="url+'/categories/'+this.item['translations'][0].slug">{{ this.item['translations'][0].name }}&emsp;<i class="icon dropdown-right-icon"
v-if="haveChildren && item.parent_id != null"></i></a>
<a :href="url+'/categories/'+this.item['translations'][0].slug">
{{ name }}&emsp;
<i class="icon dropdown-right-icon" v-if="haveChildren && item.parent_id != null"></i>
</a>
<i :class="[show ? 'icon icon-arrow-down mt-15' : 'icon dropdown-right-icon left mt-15']"
v-if="haveChildren" @click="showOrHide"></i>
@ -24,22 +26,37 @@ export default {
item: Object,
url: String,
},
data(){
data() {
return {
items_count:0,
show: false,
};
},
mounted: function() {
if(window.innerWidth > 770){
this.show = true;
}
},
computed: {
haveChildren() {
return this.item.children.length ? true : false;
},
name() {
if (this.item.translations && this.item.translations.length) {
this.item.translations.forEach(function(translation) {
if (translation.locale == document.documentElement.lang)
return translation.name;
});
}
return this.item.name;
}
},
methods: {
showOrHide: function() {
this.show = !this.show;

View File

@ -19,13 +19,16 @@ export default {
required: false,
default: () => ([])
},
url: String
},
data(){
return {
items_count:0
};
},
computed: {
items () {
return JSON.parse(this.categories)