mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-02-06 09:55:50 +00:00
add editor component for GroupForm.vue
This commit is contained in:
parent
421f8a69a2
commit
6364974b71
@ -24,12 +24,16 @@
|
|||||||
|
|
||||||
<ds-input v-model="formData.about" label="Kurzbeschreibung" rows="3"></ds-input>
|
<ds-input v-model="formData.about" label="Kurzbeschreibung" rows="3"></ds-input>
|
||||||
|
|
||||||
<ds-input
|
<hc-editor
|
||||||
v-model="formData.description"
|
:users="null"
|
||||||
label="Beschreibung"
|
:value="formData.description"
|
||||||
type="textarea"
|
:hashtags="null"
|
||||||
rows="3"
|
@input="updateEditorDescription"
|
||||||
></ds-input>
|
/>
|
||||||
|
<ds-chip size="base" :color="errors && errors.content && 'danger'">
|
||||||
|
{{ `${contentLength} / ${descriptionMin}` }}
|
||||||
|
<base-icon v-if="errors && errors.content" name="warning" />
|
||||||
|
</ds-chip>
|
||||||
|
|
||||||
<ds-select
|
<ds-select
|
||||||
icon="card"
|
icon="card"
|
||||||
@ -70,11 +74,13 @@
|
|||||||
import CategoriesSelect from '~/components/CategoriesSelect/CategoriesSelect'
|
import CategoriesSelect from '~/components/CategoriesSelect/CategoriesSelect'
|
||||||
import { CATEGORIES_MIN, CATEGORIES_MAX } from '~/constants/categories.js'
|
import { CATEGORIES_MIN, CATEGORIES_MAX } from '~/constants/categories.js'
|
||||||
import { NAME_LENGTH_MIN, NAME_LENGTH_MAX } from '~/constants/groups.js'
|
import { NAME_LENGTH_MIN, NAME_LENGTH_MAX } from '~/constants/groups.js'
|
||||||
|
import HcEditor from '~/components/Editor/Editor'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'GroupForm',
|
name: 'GroupForm',
|
||||||
components: {
|
components: {
|
||||||
CategoriesSelect,
|
CategoriesSelect,
|
||||||
|
HcEditor,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
update: {
|
update: {
|
||||||
@ -93,6 +99,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
categoriesActive: this.$env.CATEGORIES_ACTIVE,
|
categoriesActive: this.$env.CATEGORIES_ACTIVE,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
|
descriptionMin: 50,
|
||||||
formData: {
|
formData: {
|
||||||
name: name || '',
|
name: name || '',
|
||||||
groupType: groupType || '',
|
groupType: groupType || '',
|
||||||
@ -123,8 +130,15 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
contentLength() {
|
||||||
|
return this.$filters.removeHtml(this.formData.description).length
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
updateEditorDescription(value) {
|
||||||
|
this.$refs.groupForm.update('description', value)
|
||||||
|
},
|
||||||
submit() {
|
submit() {
|
||||||
const { name, about, description, groupType, actionRadius, categoryIds } = this.formData
|
const { name, about, description, groupType, actionRadius, categoryIds } = this.formData
|
||||||
const variables = {
|
const variables = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user