<template>
  <div>
    <el-row style="position: center">
      <h2>发布文章</h2>
      <el-form ref="form" :model="form" label-width="60px">
        <el-form-item label="标题">
          <el-input v-model="form.title" style="width: 70%; padding-right: 2px" />
        </el-form-item>
        <el-form-item label="分类" style="width: 70%; padding-right: 2px">
          <el-input v-model="form.category" />
        </el-form-item>
        <el-form-item label="内容">
          <rich-text @content=processContent style="width: 80%; padding-right: 2px" />
          <!-- <mavon-editor v-model="content" style="width: 90%; padding-right: 2px" />-->
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">立即投稿</el-button>
          <el-button>取消</el-button>
        </el-form-item>
      </el-form>
    </el-row>
  </div>
</template>

<script>
import RichText from '@/components/upload/RichText'

export default {
  name: 'PublishArticle',
  components: { RichText },
  data() {
    return {
      content: '',
      form: {
        title: '',
        category: '',
        content: ''
      }
    }
  },
  created() {
  },
  methods: {
    processContent(value) {
      this.form.content = value
    },
    onSubmit() {
      console.log(this.form)
    }
  }
}
</script>

<style>
</style>
