setting.html 1.1 KB

1234567891011121314151617181920212223242526272829
  1. {{define "component/settingListItem"}}
  2. <a-list-item style="padding: 20px">
  3. <a-row>
  4. <a-col :lg="24" :xl="12">
  5. <a-list-item-meta :title="title" :description="desc"/>
  6. </a-col>
  7. <a-col :lg="24" :xl="12">
  8. <template v-if="type === 'text'">
  9. <a-input :value="value" @input="$emit('input', $event.target.value)"></a-input>
  10. </template>
  11. <template v-else-if="type === 'number'">
  12. <a-input type="number" :value="value" @input="$emit('input', $event.target.value)"></a-input>
  13. </template>
  14. <template v-else-if="type === 'textarea'">
  15. <a-textarea :value="value" @input="$emit('input', $event.target.value)" :auto-size="{ minRows: 10, maxRows: 10 }"></a-textarea>
  16. </template>
  17. </a-col>
  18. </a-row>
  19. </a-list-item>
  20. {{end}}
  21. {{define "component/setting"}}
  22. <script>
  23. Vue.component('setting-list-item', {
  24. props: ["type", "title", "desc", "value"],
  25. template: `{{template "component/settingListItem"}}`,
  26. });
  27. </script>
  28. {{end}}