index.jsx 746 B

12345678910111213141516171819202122232425
  1. import { computed } from 'vue'
  2. import CipForm from '../cip-form'
  3. export default {
  4. name: 'CipFormRender',
  5. props: {
  6. scheme: Object,
  7. model: Object,
  8. equipment: { type: String, default: 'pc' }
  9. },
  10. emits: ['update:model'],
  11. setup (props, { emit }) {
  12. const fieldList = computed(() => props.scheme.list || [])
  13. const labelPosition = computed(() => props.scheme.labelPosition || 'right')
  14. const labelWidth = computed(() => props.scheme.labelWidth || 100)
  15. return () => <CipForm
  16. model={props.model}
  17. onUpdate:model={(val) => emit('update:model', val)}
  18. fieldList={fieldList.value}
  19. labelPosition={labelPosition.value}
  20. equipment={props.equipment}
  21. labelWidth={labelWidth.value}
  22. />
  23. }
  24. }