style: 修改 通告栏 代码

This commit is contained in:
就眠儀式 2022-03-21 23:13:30 +08:00
parent 7afa2488c4
commit 8d2e798f89
3 changed files with 5 additions and 49 deletions

View File

@ -53,7 +53,6 @@ export default {
:::
::: title 允许关闭
:::

View File

@ -18,14 +18,6 @@
>
{{ text }}
</div>
<div class="notice-bar-warp-slot " v-else>
<lay-carousel v-model="active" indicator="none" anim="updown" arrow="none" style="height:40px;">
<lay-carousel-item v-for="(item, ind) in textlist" :key="ind" :id="ind" class="layui-anim layui-anim-up" style="padding-top:8px;">
{{ item }}
</lay-carousel-item>
</lay-carousel>
</div>
<!-- <slot /> -->
</div>
<lay-icon
:type="rightIcon"
@ -49,17 +41,14 @@ import {
export default defineComponent({
name: "LayNoticeBar",
props: {
// closeable link
mode: {
type: String,
default: () => "",
},
//
text: {
type: String,
default: () => "",
},
//
textlist: {
type: Array,
default: [],
@ -172,36 +161,6 @@ export default defineComponent({
emit("link");
}
};
//
const active = ref(0)
if(props.scrollable == true){
console.log(props.speed)
let gdsd
if(props.speed == 100){
gdsd = 2000
}else{
gdsd = props.speed
}
nextTick(() => {
let pe = document.querySelector(".layui-carousel")
let i = 0
setInterval(() => {
i = ++i
if (pe) {
let lbsl = pe.children[0].children.length
console.log(pe.children[0])
if (i < lbsl) {
pe.children[0].children[i - 1].classList.remove("layui-this");
pe.children[0].children[i].classList.add("layui-this");
} else if (i == lbsl) {
pe.children[0].children[lbsl - 1].classList.remove("layui-this");
pe.children[0].children[0].classList.add("layui-this");
i = 0
}
}
}, gdsd);
})
}
//
onMounted(() => {
if (props.scrollable) return false;
@ -213,7 +172,6 @@ export default defineComponent({
noticeBarTextRef,
onRightIconClick,
...toRefs(state),
active
};
},
});
@ -268,5 +226,4 @@ export default defineComponent({
.notice-bar .notice-bar-warp .notice-bar-warp-right-icon:hover {
cursor: pointer;
}
</style>

View File

@ -5,9 +5,9 @@ export default {
</script>
<script setup lang="ts">
import LaySkeletonItem from "../skeletonItem/index.vue";
import "./index.less";
import { withDefaults } from "vue";
import LaySkeletonItem from "../skeletonItem/index.vue";
export interface LaySkeletonProps {
rows?: number;