property.vue 1.64 KB
Newer Older
wangcong committed
1 2 3 4 5 6 7 8 9
<template>
  <Collapse v-model="value1" class="property">
    <Panel name="1">
      列表设置
      <div slot="content">
        <Form :model="config" :label-width="80">
          <FormItem label="每行个数">
            <Input v-model="config.num" type="number"></Input>
          </FormItem>
袁成 committed
10 11 12
          <FormItem label="标题">
            <Input v-model="config.fileTitle" placeholder="资料下载"></Input>
          </FormItem>
13 14 15 16 17
          <FormItem label="分组">
            <Select v-model="config.groupId">
              <Option v-for="item in fileGroup" :value="item.value" :key="item.value">{{item.label}}</Option>
            </Select>
          </FormItem>
wangcong committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
        </Form>
      </div>
    </Panel>
  </Collapse>
</template>

<script>
export default {
  props: {
    itemSetting: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      value1: '1',
			config: {
        num: 1,
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
        fileTitle: '资料下载',
        groupId: '0'
      },
      fileGroup:  [
        {
          label: '默认分组',
          value: '0'
        },
        {
          label: '分组一',
          value: '1'
        },
        {
          label: '分组二',
          value: '2'
        },
        {
          label: '分组三',
          value: '3'
        },
        {
          label: '分组四',
          value: '4'
        },
        {
          label: '分组五',
          value: '5'
        }
      ]
wangcong committed
66 67 68
    }
  },
  created() {
袁成 committed
69
    let prop = this.itemSetting.properties
wangcong committed
70 71
		if (prop) {
			this.config = prop
袁成 committed
72 73 74
		} else {
      this.itemSetting.properties = this.config
    }
wangcong committed
75 76 77 78 79
  },
}
</script>
<style scoped lang="scss">
</style>