<template>
  <div style="padding: 0px 10px;">
    <el-form
      :model="opts"
      label-position="left"
      :rules="rules"
      label-width="100px"
      class="demo-ruleForm"
    >
      <el-form-item label="栅格" prop="span">
        <el-slider v-model="opts.span" :step="1" :min="1" :max="24" />
      </el-form-item>
      <el-form-item label="类型" prop="type">
        <el-select v-model="opts.type">
          <el-option label="text (默认)" value="text" />
          <el-option label="textarea" value="textarea" />
          <el-option label="password" value="password" />
        </el-select>
      </el-form-item>
      <el-form-item label="v-model" prop="vModel">
        <el-input v-model="opts.vModel" placeholder="绑定值" />
      </el-form-item>
      <el-form-item label="name" prop="name">
        <el-input v-model="opts.name" placeholder="name" />
      </el-form-item>
      <el-form-item label="标签" prop="labelName">
        <el-input v-model="opts.labelName" />
      </el-form-item>
      <el-form-item label="label" prop="label">
        <el-input v-model="opts.label" />
      </el-form-item>
      <el-form-item label="placeholder" prop="placeholder">
        <el-input v-model="opts.placeholder" placeholder="占位文本" />
      </el-form-item>
      <el-form-item label="只读" prop="readonly">
        <el-switch v-model="opts.readonly" />
      </el-form-item>
      <el-form-item label="禁用" prop="disabled">
        <el-switch v-model="opts.disabled" />
      </el-form-item>
      <el-form-item label="显示清空" prop="clearable">
        <el-switch v-model="opts.clearable" />
      </el-form-item>
      <el-form-item label="显示字数统计" prop="showWordLimit">
        <el-switch v-model="opts.showWordLimit" />
      </el-form-item>
      <el-button @click="test">aa</el-button>

    </el-form>
  </div>

</template>

<script>
import ApDevPropBase from './base/ApDevPropBase'
import ElButton from 'element-ui/packages/button/src/button'

// 注意点：1、表单必须绑定opts。
export default {
  name: 'ApDevInputProp',
  components: { ElButton },
  extends: ApDevPropBase,
  data() {
    return {
      rules: {
        type: [
          { required: true, message: 'type必填' }
        ],
        vModel: [
          { required: true, message: 'v-model必填' }
        ]
      }
    }
  },
  methods: {
    test() {
      console.log(this.opts)
    }
  }
}
</script>


<style scoped>
</style>
