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 允许关闭 ::: title 允许关闭
::: :::

View File

@ -18,14 +18,6 @@
> >
{{ text }} {{ text }}
</div> </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> </div>
<lay-icon <lay-icon
:type="rightIcon" :type="rightIcon"
@ -49,17 +41,14 @@ import {
export default defineComponent({ export default defineComponent({
name: "LayNoticeBar", name: "LayNoticeBar",
props: { props: {
// closeable link
mode: { mode: {
type: String, type: String,
default: () => "", default: () => "",
}, },
//
text: { text: {
type: String, type: String,
default: () => "", default: () => "",
}, },
//
textlist: { textlist: {
type: Array, type: Array,
default: [], default: [],
@ -172,36 +161,6 @@ export default defineComponent({
emit("link"); 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(() => { onMounted(() => {
if (props.scrollable) return false; if (props.scrollable) return false;
@ -213,7 +172,6 @@ export default defineComponent({
noticeBarTextRef, noticeBarTextRef,
onRightIconClick, onRightIconClick,
...toRefs(state), ...toRefs(state),
active
}; };
}, },
}); });
@ -268,5 +226,4 @@ export default defineComponent({
.notice-bar .notice-bar-warp .notice-bar-warp-right-icon:hover { .notice-bar .notice-bar-warp .notice-bar-warp-right-icon:hover {
cursor: pointer; cursor: pointer;
} }
</style> </style>

View File

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