1234567891011121314151617181920212223242526272829303132 |
- <template>
- <view>
- <u-input v-model="value" type="select" :border="true" :disabled="!config.writable" @click="show = true" />
- <u-select v-model="show" :list="options" @confirm="confirm"></u-select>
- </view>
- </template>
- <script>
- export default {
- name: 'SELECT',
- props: ['config', 'onChange'],
- data() {
- return {
- value: '',
- options: [],
- show: false
- }
- },
- created() {
- this.value = this.config.value || ''
- this.options = this.config.options || []
- },
- methods: {
- confirm(arr) {
- this.onChange({ prop: this.config.formName, value: arr[0].value })
- this.value = arr[0].value
- }
- }
- }
- </script>
- <style></style>
|