2022-07-19 03:58:19 +00:00
|
|
|
<template>
|
|
|
|
<div class="edit-article--container">
|
|
|
|
<input
|
|
|
|
v-model="articleTitle"
|
|
|
|
type="text"
|
|
|
|
class="article-heading"
|
|
|
|
:placeholder="$t('HELP_CENTER.EDIT_ARTICLE.TITLE_PLACEHOLDER')"
|
|
|
|
@focus="onFocus"
|
|
|
|
@blur="onBlur"
|
2022-07-26 06:09:53 +00:00
|
|
|
@input="onTitleInput"
|
2022-07-19 03:58:19 +00:00
|
|
|
/>
|
|
|
|
<woot-message-editor
|
|
|
|
v-model="articleContent"
|
|
|
|
class="article-content"
|
|
|
|
:placeholder="$t('HELP_CENTER.EDIT_ARTICLE.CONTENT_PLACEHOLDER')"
|
|
|
|
:is-format-mode="true"
|
|
|
|
@focus="onFocus"
|
|
|
|
@blur="onBlur"
|
2022-07-26 06:09:53 +00:00
|
|
|
@input="onContentInput"
|
2022-07-19 03:58:19 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import WootMessageEditor from 'dashboard/components/widgets/WootWriter/Editor.vue';
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
WootMessageEditor,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
article: {
|
|
|
|
type: Object,
|
|
|
|
default: () => ({}),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
articleTitle: '',
|
|
|
|
articleContent: '',
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.articleTitle = this.article.title;
|
|
|
|
this.articleContent = this.article.content;
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onFocus() {
|
|
|
|
this.$emit('focus');
|
|
|
|
},
|
|
|
|
onBlur() {
|
|
|
|
this.$emit('blur');
|
|
|
|
},
|
2022-07-26 06:09:53 +00:00
|
|
|
onTitleInput() {
|
|
|
|
this.$emit('titleInput', this.articleTitle);
|
|
|
|
},
|
|
|
|
onContentInput() {
|
|
|
|
this.$emit('contentInput', this.articleContent);
|
|
|
|
},
|
2022-07-19 03:58:19 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.edit-article--container {
|
|
|
|
margin: var(--space-medium) var(--space-giga);
|
|
|
|
min-width: 640px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.article-heading {
|
|
|
|
font-size: var(--font-size-giga);
|
|
|
|
font-weight: var(--font-weight-bold);
|
|
|
|
min-height: var(--space-jumbo);
|
|
|
|
max-height: var(--space-jumbo);
|
|
|
|
border: 0px solid transparent;
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
::v-deep {
|
|
|
|
.ProseMirror-menubar-wrapper {
|
|
|
|
.ProseMirror-menubar .ProseMirror-menuitem {
|
|
|
|
.ProseMirror-icon {
|
|
|
|
margin-right: var(--space-normal);
|
|
|
|
font-size: var(--font-size-small);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.ProseMirror-woot-style {
|
|
|
|
min-height: var(--space-giga);
|
|
|
|
max-height: 100%;
|
|
|
|
|
|
|
|
p {
|
|
|
|
font-size: var(--font-size-default);
|
|
|
|
line-height: 1.5;
|
|
|
|
}
|
|
|
|
|
|
|
|
li::marker {
|
|
|
|
font-size: var(--font-size-default);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|