新年的第一次提交

This commit is contained in:
就眠儀式
2022-02-01 07:23:20 +08:00
parent 5fe02df5db
commit 126d20bc3f
77 changed files with 1393 additions and 1297 deletions

View File

@@ -1,9 +1,8 @@
import type { App } from "vue";
import Component from "./index.vue";
import type { IDefineComponent } from "../../types/index";
Component.install = (app: App) => {
app.component(Component.name || "LayCarousel", Component);
app.component(Component.name, Component);
};
export default Component as IDefineComponent;
export default Component;

View File

@@ -1,40 +1,10 @@
<template>
<div
class="layui-carousel"
:lay-anim="anim"
:lay-indicator="indicator"
:lay-arrow="arrow"
:style="{ width: width, height: height }"
>
<div carousel-item>
<slot></slot>
</div>
<div class="layui-carousel-ind">
<ul>
<li
v-for="ss in slots"
:key="ss"
:class="[ss.props.id === active ? 'layui-this' : '']"
@click.stop="change(ss.props.id)"
></li>
</ul>
</div>
<button
class="layui-icon layui-carousel-arrow"
lay-type="sub"
@click="prev"
>
{{ anim === "updown" ? "" : "" }}</button
><button
class="layui-icon layui-carousel-arrow"
lay-type="add"
@click="next"
>
{{ anim === "updown" ? "" : "" }}
</button>
</div>
</template>
<script setup name="LayCarousel" lang="ts">
<script lang="ts">
export default {
name: "LayCarousel"
}
</script>
<script setup lang="ts">
import {
withDefaults,
defineProps,
@@ -107,3 +77,40 @@ const next = function () {
}
};
</script>
<template>
<div
class="layui-carousel"
:lay-anim="anim"
:lay-indicator="indicator"
:lay-arrow="arrow"
:style="{ width: width, height: height }"
>
<div carousel-item>
<slot></slot>
</div>
<div class="layui-carousel-ind">
<ul>
<li
v-for="ss in slots"
:key="ss"
:class="[ss.props.id === active ? 'layui-this' : '']"
@click.stop="change(ss.props.id)"
></li>
</ul>
</div>
<button
class="layui-icon layui-carousel-arrow"
lay-type="sub"
@click="prev"
>
{{ anim === "updown" ? "" : "" }}</button
><button
class="layui-icon layui-carousel-arrow"
lay-type="add"
@click="next"
>
{{ anim === "updown" ? "" : "" }}
</button>
</div>
</template>