cione-comp-lib
Version:
`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`
72 lines (71 loc) • 2.51 kB
JavaScript
import Button from "../components/inputs/Button.mjs";
import Input from "../components/inputs/Input.mjs";
import { ref, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, createVNode, withKeys, withCtx, createTextVNode, toDisplayString } from "vue";
import style0 from "./Login.vue_used_vue_type_style_index_0_lang.module.mjs";
import _export_sfc from "../../../_virtual/plugin-vue_export-helper.mjs";
const _sfc_main = {
name: "Login",
emits: ["submit", "cancel"],
components: {
Button,
Input
},
setup(_, { emit }) {
let password = ref("");
const hanndleCancel = () => {
emit("cancel");
};
return {
password,
hanndleCancel,
onSubmit: () => emit("submit", {
password: password.value
})
};
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_Input = resolveComponent("Input");
const _component_Button = resolveComponent("Button");
return openBlock(), createElementBlock("div", {
class: normalizeClass(_ctx.$style.login)
}, [
createElementVNode("form", {
onSubmit: _cache[2] || (_cache[2] = withModifiers((...args) => $setup.onSubmit && $setup.onSubmit(...args), ["prevent"]))
}, [
createVNode(_component_Input, {
modelValue: $setup.password,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.password = $event),
type: "password",
tabindex: "1",
autofocus: true,
placeholder: "\u8BF7\u8F93\u5165\u8FDE\u63A5\u5BC6\u7801",
onKeydown: _cache[1] || (_cache[1] = withKeys(($event) => _ctx.$emit("cancel", $event), ["esc"]))
}, null, 8, ["modelValue"]),
createElementVNode("div", {
class: normalizeClass(_ctx.$style.button)
}, [
createVNode(_component_Button, { onClick: $setup.hanndleCancel }, {
default: withCtx(() => [
createTextVNode(toDisplayString("\u53D6\u6D88"))
]),
_: 1
}, 8, ["onClick"]),
createVNode(_component_Button, {
type: "submit",
tabindex: "2"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString("\u8FDE\u63A5") + " ")
]),
_: 1
})
], 2)
], 32)
], 2);
}
const cssModules = {
"$style": style0
};
var Login = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__cssModules", cssModules]]);
export { Login as default };