This commit is contained in:
2025-06-13 21:01:33 +08:00
parent 376d9d5cfe
commit 88a8d119cf
15 changed files with 429 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
<script setup>
import {onMounted, ref} from "vue";
import {onMounted, ref, watch} from "vue";
import warn from '../static/icons/warn.png';
import success from '../static/icons/info.png';
@@ -37,6 +37,22 @@ const XNoticeBox = ref();
const Context = ref();
const roll = ref(false);
watch(
() => text,
() => {
if (!tile) {
if (
Context.value.$el.clientWidth
>
XNoticeBox.value.$el.clientWidth
) {
roll.value = true;
}
}
},
{deep: true}
)
onMounted(() => {
if (!tile) {
if (
@@ -56,9 +72,9 @@ onMounted(() => {
:style="{alignItems: tile ? 'start' : 'center'}">
<image v-if="status==='error'" class="!size-[26rpx] flex-shrink-0" :src="warn"></image>
<image v-else class="!size-[26rpx] flex-shrink-0" :src="success"></image>
<text v-if="!tile" class="!whitespace-nowrap flex-shrink-0" :style="{color: textColor}">{{ text }}</text>
<text v-else :style="{color: textColor}">
{{ text }}
<text v-if="!tile" class="!whitespace-nowrap flex-shrink-0" :style="{color: textColor}"
v-html="text"></text>
<text v-else :style="{color: textColor}" v-html="text">
</text>
</view>
</view>