various-ui
Version:
This is a test version of the Vue 3 component library
97 lines (92 loc) • 3.59 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var index = require('./index.js');
var composable = require('./src/composable.js');
var index$1 = require('../../icon/index.js');
const __default__ = vue.defineComponent({ name: "UiCarouselMultipleView" });
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: index.UiCarouselMultipleViewPropsOption,
emits: index.UiCarouselMultipleViewEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const define = __props;
const emits = __emit;
const { refs, methods, computeds, variable } = composable.useComposable(define, emits);
const { main, container } = refs;
const { switchCarousel, switchBack, switchNext, init } = methods;
const { style, className, isLastControl, isFirstControl } = computeds;
vue.onMounted(() => {
if (!main.value) return;
else {
variable.observer = new ResizeObserver(() => methods.init());
variable.observer.observe(main.value);
}
});
vue.onBeforeUnmount(() => {
variable.observer && variable.observer.disconnect();
refs.autoTimer.value && clearInterval(refs.autoTimer.value);
});
;
__expose({ init, switchBack, switchNext, switchCarousel });
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["ui-mv-carousel", vue.unref(className)]),
style: vue.normalizeStyle(vue.unref(style))
},
[
vue.createCommentVNode(" \u8F6E\u64AD\u56FE\u5BB9\u5668, \u7528\u6765\u63A7\u5236\u8F6E\u64AD\u6EDA\u52A8 "),
vue.createElementVNode(
"div",
{
class: "ui-mv-carousel-main",
ref_key: "main",
ref: main
},
[
vue.createElementVNode(
"div",
{
class: "ui-mv-carousel-container",
ref_key: "container",
ref: container
},
[
vue.renderSlot(_ctx.$slots, "default")
],
512
/* NEED_PATCH */
)
],
512
/* NEED_PATCH */
),
vue.createCommentVNode(" \u8F6E\u64AD\u56FE\u5DE6\u4FA7\u7BAD\u5934 "),
vue.unref(isFirstControl) ? vue.renderSlot(_ctx.$slots, "arrow-back", { key: 0 }, () => [
vue.createElementVNode("div", {
class: "ui-mv-carousel-control ui-mv-carousel-left-control",
onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(switchCarousel)(-1))
}, [
vue.createVNode(vue.unref(index$1.UiIcon), { name: "arrow" })
])
]) : vue.createCommentVNode("v-if", true),
vue.createCommentVNode(" \u8F6E\u64AD\u56FE\u53F3\u4FA7\u7BAD\u5934 "),
vue.unref(isLastControl) ? vue.renderSlot(_ctx.$slots, "arrow-next", { key: 1 }, () => [
vue.createElementVNode("div", {
class: "ui-mv-carousel-control ui-mv-carousel-right-control",
onClick: _cache[1] || (_cache[1] = ($event) => vue.unref(switchCarousel)(1))
}, [
vue.createVNode(vue.unref(index$1.UiIcon), { name: "arrow" })
])
]) : vue.createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
);
};
}
});
exports.default = _sfc_main;
//# sourceMappingURL=index.vue2.js.map