<template>
  <app-container title="意见反馈">
    <el-form :model="ruleForm" :rules="rules" label-position="top" ref="ruleForm" class="form">
      <el-form-item label="留下您的宝贵意见" prop="contents">
        <el-input type="textarea" v-model="ruleForm.contents" :autosize="{ minRows: 6, maxRows: 10 }"></el-input>
      </el-form-item>
      <el-form-item label="您的联系方式" prop="title">
        <el-input v-model="ruleForm.title" style="max-width: 280px"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="handleSubmit">提交</el-button>
      </el-form-item>
    </el-form>
  </app-container>
</template>

<script>
import AppContainer from '@/components/AppContainer'
export default {
  components: { AppContainer },
  data() {
    return {
      ruleForm: {
        contents: '',
        title: ''
      },
      rules: {}
    }
  },
  methods: {
    handleSubmit() {
      this.$refs.ruleForm.validate().then(this.handleSubmitRequest)
    },
    handleSubmitRequest() {
      console.log(this.ruleForm)
    }
  }
}
</script>

<style lang="scss" scoped>
.form {
  max-width: 700px;
}
</style>
