cione-comp-lib
Version:
`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`
50 lines (49 loc) • 1.62 kB
JavaScript
import { openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, toDisplayString, createCommentVNode, mergeProps } from "vue";
import style0 from "./Input.vue_used_vue_type_style_index_0_lang.module.mjs";
import _export_sfc from "../../../../_virtual/plugin-vue_export-helper.mjs";
const _sfc_main = {
name: "Input",
inheritAttrs: false,
props: {
label: {
type: String,
default: ""
},
autofocus: {
type: Boolean,
default: false
}
},
emits: ["update:modelValue"],
mounted() {
if (this.autofocus) {
this.$refs.input.focus();
}
}
};
const _hoisted_1 = ["type"];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", {
class: normalizeClass(_ctx.$style.input)
}, [
createElementVNode("label", null, [
$props.label ? (openBlock(), createElementBlock("span", {
key: 0,
onContextmenu: _cache[0] || (_cache[0] = withModifiers(() => {
}, ["prevent"]))
}, toDisplayString($props.label), 33)) : createCommentVNode("", true),
createElementVNode("input", mergeProps({
ref: "input",
autocomplete: "off"
}, _ctx.$attrs, {
type: _ctx.$attrs.type || "text",
onInput: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:modelValue", $event.target.value))
}), null, 16, _hoisted_1)
])
], 2);
}
const cssModules = {
"$style": style0
};
var Input = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__cssModules", cssModules]]);
export { Input as default };