<script>
import { Select, Option } from 'element-ui'
export default {
  props: {
    options: {
      type: Array,
      default: () => [],
    },
    value: {},
  },
  render(h) {
    return h(
      Select,
      {
        on: this.$listeners,
        attrs: this.$attrs,
        props: {
          value: this.value,
        },
        scopedSlots: this.$scopedSlots,
      },
      this.options.map((op) =>
        h(Option, {
          props: {
            key: op.value,
            label: op.label,
            value: op.value,
          },
        }),
      ),
    )
  },
}
</script>

 

posted on 2021-01-26 09:28  jzfan  阅读(526)  评论(0编辑  收藏  举报