SELECT.vue 719 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <view>
  3. <u-input v-model="value" type="select" :border="true" :disabled="!config.writable" @click="show = true" />
  4. <u-select v-model="show" :list="options" @confirm="confirm"></u-select>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. name: 'SELECT',
  10. props: ['config', 'onChange'],
  11. data() {
  12. return {
  13. value: '',
  14. options: [],
  15. show: false
  16. }
  17. },
  18. created() {
  19. this.value = this.config.value || ''
  20. this.options = this.config.options || []
  21. },
  22. methods: {
  23. confirm(arr) {
  24. this.onChange({ prop: this.config.formName, value: arr[0].value })
  25. this.value = arr[0].value
  26. }
  27. }
  28. }
  29. </script>
  30. <style></style>