birdpaper-ui
Version:
一个通用的 vue3 UI组件库。A common vue3 UI component library.
63 lines (62 loc) • 3.23 kB
JavaScript
"use strict";
const input_vue_vue_type_script_lang = require("./input.vue2.js");
const vue = require("vue");
const _pluginVue_exportHelper = require("../../_virtual/_plugin-vue_export-helper.js");
const _hoisted_1 = ["name", "type", "disabled", "readonly", "cursor", "placeholder", "maxlength", "value"];
const _hoisted_2 = ["textContent"];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
var _a;
const _component_IconCloseLine = vue.resolveComponent("IconCloseLine");
return vue.openBlock(), vue.createElementBlock("div", {
class: vue.normalizeClass(_ctx.inpClass)
}, [
_ctx.slots.perfix ? (vue.openBlock(), vue.createElementBlock("div", {
key: 0,
class: vue.normalizeClass(`${_ctx.name}-perfix`)
}, [
vue.renderSlot(_ctx.$slots, "perfix")
], 2)) : vue.createCommentVNode("", true),
vue.createElementVNode("input", {
ref: "inpRef",
name: _ctx.inputName,
class: vue.normalizeClass(["bp-input-inner", { "has-perfix": _ctx.slots.perfix }]),
type: _ctx.inpType,
spellcheck: false,
disabled: _ctx.disabled,
readonly: _ctx.readonly,
cursor: (_a = _ctx.modelValue) == null ? void 0 : _a.length,
placeholder: _ctx.placeholder,
maxlength: _ctx.maxlength,
value: _ctx.modelValue,
onFocus: _cache[0] || (_cache[0] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
onBlur: _cache[1] || (_cache[1] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
onKeypress: _cache[2] || (_cache[2] = (...args) => _ctx.onKeypress && _ctx.onKeypress(...args)),
onKeyup: _cache[3] || (_cache[3] = (...args) => _ctx.onKeyup && _ctx.onKeyup(...args)),
onInput: _cache[4] || (_cache[4] = (...args) => _ctx.onInput && _ctx.onInput(...args))
}, null, 42, _hoisted_1),
_ctx.slots.suffix || _ctx.showClear || _ctx.showWordLimit || _ctx.type === "password" ? (vue.openBlock(), vue.createElementBlock("div", {
key: 1,
class: vue.normalizeClass(`${_ctx.name}-suffix`)
}, [
_ctx.showClear ? (vue.openBlock(), vue.createBlock(_component_IconCloseLine, {
key: 0,
class: "click-icon",
onClick: vue.withModifiers(_ctx.handleClear, ["stop"])
}, null, 8, ["onClick"])) : vue.createCommentVNode("", true),
!_ctx.slots.suffix ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
_ctx.showWordLimit ? (vue.openBlock(), vue.createElementBlock("span", {
key: 0,
textContent: vue.toDisplayString(_ctx.limitText)
}, null, 8, _hoisted_2)) : vue.createCommentVNode("", true),
_ctx.type === "password" ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.showPassword ? _ctx.IconEyeFill : _ctx.IconEyeCloseFill), {
key: 1,
onClick: _ctx.triggerPassword,
class: "click-icon"
}, null, 8, ["onClick"])) : vue.createCommentVNode("", true)
], 64)) : vue.createCommentVNode("", true),
vue.renderSlot(_ctx.$slots, "suffix")
], 2)) : vue.createCommentVNode("", true)
], 2);
}
const BpInput = /* @__PURE__ */ _pluginVue_exportHelper(input_vue_vue_type_script_lang, [["render", _sfc_render]]);
module.exports = BpInput;