hongluan-ui
Version:
Hongluan Component Library for Vue 3
60 lines (55 loc) • 2.04 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var index$1 = require('../../icon/index.js');
require('../../system-icon/index.js');
require('../../../hooks/index.js');
var backtop = require('./backtop.js');
var useBacktop = require('./use-backtop.js');
var index = require('../../../hooks/use-namespace/index.js');
var arrowUp = require('../../system-icon/src/arrow-up.js');
const COMPONENT_NAME = "Backtop";
const __default__ = vue.defineComponent({
name: COMPONENT_NAME
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: backtop.backtopProps,
emits: backtop.backtopEmits,
setup(__props, { emit }) {
const props = __props;
const { namespace } = index.useNamespace("backtop");
const { handleClick, visible } = useBacktop.useBackTop(props, emit, COMPONENT_NAME);
const backTopStyle = vue.computed(() => ({
right: `${props.right}px`,
bottom: `${props.bottom}px`
}));
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.Transition, { name: "fade" }, {
default: vue.withCtx(() => [
vue.unref(visible) ? (vue.openBlock(), vue.createElementBlock("div", {
key: 0,
style: vue.normalizeStyle(vue.unref(backTopStyle)),
class: vue.normalizeClass(vue.unref(namespace)),
onClick: vue.withModifiers(vue.unref(handleClick), ["stop"])
}, [
vue.renderSlot(_ctx.$slots, "default", {}, () => [
vue.createVNode(vue.unref(index$1.HlIcon), {
name: "chevronsTop",
opacity: 0
}, {
default: vue.withCtx(() => [
vue.createVNode(vue.unref(arrowUp["default"]))
]),
_: 1
})
])
], 14, ["onClick"])) : vue.createCommentVNode("v-if", true)
]),
_: 3
});
};
}
});
exports["default"] = _sfc_main;
//# sourceMappingURL=backtop2.js.map