mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
feat(webapp): group categories on posts
This commit is contained in:
parent
e2667a1a98
commit
3244f3f86d
@ -43,6 +43,13 @@ export default {
|
|||||||
selectedCategoryIds: this.existingCategoryIds,
|
selectedCategoryIds: this.existingCategoryIds,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
existingCategoryIds() {
|
||||||
|
console.log('existingCategoryIds', this.selectedCategoryIds)
|
||||||
|
if (!this.selectedCategoryIds.length)
|
||||||
|
this.selectedCategoryIds = this.existingCategoryIds
|
||||||
|
},
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
selectedCount() {
|
selectedCount() {
|
||||||
return this.selectedCategoryIds.length
|
return this.selectedCategoryIds.length
|
||||||
|
|||||||
@ -138,7 +138,7 @@ export default {
|
|||||||
imageAspectRatio,
|
imageAspectRatio,
|
||||||
imageType,
|
imageType,
|
||||||
imageBlurred,
|
imageBlurred,
|
||||||
categoryIds: categories ? categories.map((category) => category.id) : [],
|
categoryIds: categories ? categories.map((category) => category.id) : []
|
||||||
},
|
},
|
||||||
formSchema: {
|
formSchema: {
|
||||||
title: { required: true, min: 3, max: 100 },
|
title: { required: true, min: 3, max: 100 },
|
||||||
@ -177,6 +177,15 @@ export default {
|
|||||||
groupName() {
|
groupName() {
|
||||||
return this.group && this.group.name
|
return this.group && this.group.name
|
||||||
},
|
},
|
||||||
|
groupCategories() {
|
||||||
|
return this.group && this.group.categories
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
groupCategories() {
|
||||||
|
console.log('groupCategories', this.groupCategories)
|
||||||
|
if (!this.formData.categoryIds && this.groupCategories) this.formData.categoryIds = this.groupCategories
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
submit() {
|
submit() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user