ideaz-element
Version:
<p align="center"> <a href="" target="_blank" rel="noopener noreferrer"> <img src="./docs/public/logo.svg" alt="Ideaz Element" width="180" style="width: 180px;" /> </a> </p>
48 lines (47 loc) • 1.34 kB
JavaScript
import { defineComponent as c, computed as a, createVNode as e } from "vue";
import { ArrowDown as d } from "@element-plus/icons-vue";
import { ElButton as p, ElIcon as i } from "element-plus";
import { useFormSize as g } from "../../../hooks/useFormSize.mjs";
import { useNamespace as f } from "../../../hooks/useNamespace.mjs";
import { useLocale as x } from "../../../hooks/useLocale.mjs";
const b = /* @__PURE__ */ c({
name: "ToggleButton",
props: {
modelValue: {
type: String,
default: "expand"
}
},
emits: ["update:modelValue"],
setup(t, {
emit: n
}) {
const r = g(), o = f("form"), {
t: l
} = x(), u = a(() => t.modelValue === "expand" ? l("tagSelect.expand") : l("tagSelect.retract")), m = a(() => ({
"z-toggle__icon": !0,
"z-icon__arrow": t.modelValue !== "expand"
})), s = () => {
n("update:modelValue", t.modelValue === "expand" ? "up" : "expand");
};
return () => e("div", {
class: o.b("toggle"),
onClick: s
}, [e(p, {
class: o.b("toggle-button"),
link: !0,
type: "primary",
size: r.value
}, {
default: () => [u.value, e(i, {
class: m.value
}, {
default: () => [e(d, null, null)]
})]
})]);
}
});
export {
b as default
};
//# sourceMappingURL=ToggleButton.mjs.map