<template>
  <div>
    <el-form ref="form" :model="updateForm" :rules="rules" label-width="80px">
      <el-form-item label="标题" prop="title">
        <el-input v-model="updateForm.title" placeholder="请输入标题" />
      </el-form-item>
      <el-form-item label="城市" prop="cityId">
        <el-select v-model="updateForm.cityId" placeholder="请选择">
          <el-option
            v-for="item in cityList"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="封面" prop="cover">
        <imageUpload v-model="updateForm.cover"></imageUpload>
      </el-form-item>
      <el-form-item label="内容" prop="info">
        <editor v-model="updateForm.content" :min-height="192" />
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  props: {
    form:{
        type:Object,
        default:()=>{}
    },
  },
  data() {
    return {
      // 表单参数
      updateForm: this.form,
      // 表单校验
      rules: {},
      cityList: [
        {
          value: "1",
          label: "北京",
        },
        {
          value: "2",
          label: "上海",
        },
      ],
    };
  },
};
</script>

<style lang="scss" scoped></style>
