@varlet/ui
Version:
A Vue3 component library based on Material Design 2 and 3, supporting mobile and desktop.
50 lines (49 loc) • 1.48 kB
JavaScript
import { computed, defineComponent } from "vue";
import { call } from "@varlet/shared";
import { createNamespace } from "../utils/components.mjs";
import { props } from "./props.mjs";
import { useStep } from "./provide.mjs";
const { name, n } = createNamespace("steps");
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
function __render__(_ctx, _cache) {
return _openBlock(), _createElementBlock(
"div",
{
class: _normalizeClass(_ctx.n()),
style: _normalizeStyle({ flexDirection: _ctx.direction === "horizontal" ? "row" : "column" })
},
[
_renderSlot(_ctx.$slots, "default")
],
6
/* CLASS, STYLE */
);
}
const __sfc__ = defineComponent({
name,
props,
setup(props2) {
const active = computed(() => props2.active);
const activeColor = computed(() => props2.activeColor);
const inactiveColor = computed(() => props2.inactiveColor);
const direction = computed(() => props2.direction);
const { bindStep } = useStep();
const stepsProvider = {
active,
direction,
activeColor,
inactiveColor,
clickStep
};
bindStep(stepsProvider);
function clickStep(index) {
call(props2.onClickStep, index);
}
return { n };
}
});
__sfc__.render = __render__;
var stdin_default = __sfc__;
export {
stdin_default as default
};