update
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user