# 拖拽表单设计

## 设计

```json
 sex:{ //sex表示该input的name
        type:"input", //表单类型，有input,select,checkbox.
        label:'', //该input的标签
        value:'', //该input或的值
        disabled:false,//该input是否禁用,在流程中方便控制
        readOnly:false,//该input是否为只读,在流程中方便控制
        attr:''  //自定义属性，待定
        flowVar:''//流程变量，后台服务定义，比如${creator},${creatorDept},${deptLeader},${deptName}
},

```


```vue
<template>
  <div>
    <a-tabs :activ-key="activeKey">
      <a-tab-pane :key="1" tab="设计" force-render>
        <design-widget></design-widget>
      </a-tab-pane>
      <a-tab-pane :key="2" tab="JSON" force-render>
        <json-widget></json-widget>
      </a-tab-pane>
      <span slot="tabBarExtraContent" class="tab-extra" >
        <span>       
           <a-button  size="small">清空</a-button>
        </span>
        <span>        
          <a-button  size="small">预览</a-button>
        </span>
      </span>
    </a-tabs>
  </div>
</template>

<script>
import designWidget from './design'
import jsonWidget from './json'
export default {
  name:'design-panel',
  components:{
    designWidget,
    jsonWidget
  },
  data(){
    return {
      activeKey:1
    }
  }
}
</script>
<style lang="less">
.tab-extra{
  margin-right: 180px;
  span {
    padding:0 20px;
  }

}
</style>

```