vxe-table-pro
Version:
Vue table plugins based on vxe-table
54 lines (53 loc) • 1.24 kB
JavaScript
import { defineComponent as p, ref as i, watch as h, resolveComponent as s, createBlock as V, openBlock as f, withKeys as g } from "vue";
const y = /* @__PURE__ */ p({
__name: "index",
props: {
placeholder: {
type: String,
default: "请输入"
},
maxLength: {
type: Number
},
onSearch: {
type: Function,
default: () => {
}
},
modelValue: {
type: String,
default: ""
},
form: {
type: Object
}
},
emits: ["update:modelValue"],
setup(n, { emit: a }) {
const l = i(""), t = n, u = a;
h(() => [t.modelValue], () => {
l.value = t.modelValue;
});
const m = (e) => {
l.value = e, u("update:modelValue", e);
}, c = () => {
var e;
(e = t.onSearch) == null || e.call(t);
};
return (e, o) => {
const d = s("el-input");
return f(), V(d, {
modelValue: l.value,
"onUpdate:modelValue": o[0] || (o[0] = (r) => l.value = r),
placeholder: n.placeholder,
clearable: "",
maxlength: n.maxLength,
onKeyup: g(c, ["enter"]),
onInput: m
}, null, 8, ["modelValue", "placeholder", "maxlength"]);
};
}
});
export {
y as default
};