property.vue 888 Bytes
Newer Older
wangcong committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
<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>
        </Form>
      </div>
    </Panel>
  </Collapse>
</template>

<script>
export default {
  watch: {
    'config.num': {
      handler(newVal) {
        this.itemSetting.properties.num = newVal;
      },
      deep: true,
    },
  },
  props: {
    itemSetting: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      value1: '1',
			config: {
        num: 7,
      }
    }
  },
  created() {
    let prop = this.itemSetting.properties
		if (prop && prop.num) {
			this.config.num = prop.num;
		}
  },
}
</script>
<style scoped lang="scss">
</style>