vuux
Version:
Vue3 Nuxt3 Nuxt4 组件库
33 lines (32 loc) • 876 B
JavaScript
import { defineComponent as c, useTemplateRef as p, createElementBlock as m, openBlock as d, normalizeStyle as t, unref as f, createElementVNode as x, renderSlot as u } from "vue";
import { useAffix as y } from "./hook/useAffix.mjs";
const k = /* @__PURE__ */ c({
name: "Affix",
__name: "index",
props: {
target: {},
offset: { default: 0 },
position: { default: "top" },
zIndex: { default: 100 }
},
emits: ["change", "scroll"],
setup(a, { emit: o }) {
const l = a, s = o, e = p("affixEl"), { affixStyle: n, affixRefStyle: i } = y(l, e, s);
return (r, _) => (d(), m("div", {
ref_key: "affixEl",
ref: e,
class: "app-affix",
style: t(f(i))
}, [
x("div", {
class: "affix-wrap",
style: t(f(n))
}, [
u(r.$slots, "default")
], 4)
], 4));
}
});
export {
k as default
};