UNPKG

dm-vue3-ui

Version:

This Components Library will help get you started developing in Vue 3.

42 lines (41 loc) 1.23 kB
import { Select } from "ant-design-vue/es"; import { defineComponent, ref, computed, openBlock, createBlock, nextTick } from "vue"; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "select", props: { data: { default: () => ({}) } }, emits: ["apply"], setup(__props, { emit: __emit }) { const props = __props; const emit = __emit; const value = ref(""); const placeholder = computed(() => { if (props.data.placeholder) { return props.data.placeholder; } else { return `输入${props.data.label}`; } }); const change = (value2) => { let data = { field: props.data.field, value: value2 }; nextTick(() => { value2.value = void 0; emit("apply", data); }); }; return (_ctx, _cache) => { const _component_a_select = Select; return openBlock(), createBlock(_component_a_select, { value: value.value, "onUpdate:value": _cache[0] || (_cache[0] = ($event) => value.value = $event), placeholder: placeholder.value, options: _ctx.data.options, onChange: change }, null, 8, ["value", "placeholder", "options"]); }; } }); export { _sfc_main as default };