Compare commits

...

2 Commits

Author SHA1 Message Date
TAYUN
1c315a9c02
style(toast): 调整toast组件样式间距并添加左边距变量(破坏性更新) (#1329)
* style(toast): 调整toast组件样式间距并添加左边距变量

移除图标右边距,为消息内容添加左边距变量以保持样式一致性

* feat(toast): 添加垂直方向时的消息样式

当direction为vertical时,移除消息的左外边距并添加垂直布局样式

* style(wd-toast): 移除垂直布局下多余的右边距

垂直布局时图标不需要右边距,保持样式简洁

* style(toast): 优化成仅在图标显示的时候显示文字左边距

* refactor(样式变量): 移除未使用的toast图标右边距变量
2025-11-06 13:21:13 +08:00
zhangpan1213287670
84ecdd32c1
style(video-preview): 调整变量名 (#1334) 2025-11-06 12:59:04 +08:00
4 changed files with 20 additions and 16 deletions

View File

@ -651,7 +651,7 @@ $-toast-fs: var(--wot-toast-fs, $-fs-content) !default; // 字号
$-toast-line-height: var(--wot-toast-line-height, 20px) !default; // 行高 $-toast-line-height: var(--wot-toast-line-height, 20px) !default; // 行高
$-toast-with-icon-min-width: var(--wot-toast-with-icon-min-width, 150px) !default; // 有图标的情况下最小宽度 $-toast-with-icon-min-width: var(--wot-toast-with-icon-min-width, 150px) !default; // 有图标的情况下最小宽度
$-toast-icon-size: var(--wot-toast-icon-size, 32px) !default; // 图标大小 $-toast-icon-size: var(--wot-toast-icon-size, 32px) !default; // 图标大小
$-toast-icon-margin-right: var(--wot-toast-icon-margin-right, 12px) !default; // 图标右边距 $-toast-msg-margin-left: var(--wot-toast-msg-margin-left, 12px) !default; // 消息内容左边距
$-toast-icon-margin-bottom: var(--wot-toast-icon-margin-bottom, 12px) !default; // 图标下边距 $-toast-icon-margin-bottom: var(--wot-toast-icon-margin-bottom, 12px) !default; // 图标下边距
$-toast-loading-padding: var(--wot-toast-loading-padding, 10px) !default; // loading状态下的padding $-toast-loading-padding: var(--wot-toast-loading-padding, 10px) !default; // loading状态下的padding
$-toast-loading-margin-bottom: var(--wot-toast-loading-margin-bottom, 16px) !default; // loading动画的margin-bottom $-toast-loading-margin-bottom: var(--wot-toast-loading-margin-bottom, 16px) !default; // loading动画的margin-bottom

View File

@ -24,13 +24,11 @@
text-align: left; text-align: left;
font-family: "San Francisco", Rotobo, arial, "PingFang SC", "Noto SansCJK", "Microsoft Yahei", sans-serif; font-family: "San Francisco", Rotobo, arial, "PingFang SC", "Noto SansCJK", "Microsoft Yahei", sans-serif;
} }
@include edeep(icon) { @include edeep(icon) {
display: inline-block; display: inline-block;
margin-right: $-toast-icon-margin-right;
font-size: $-toast-icon-size; font-size: $-toast-icon-size;
@include when(vertical) { @include when(vertical) {
margin-right: 0;
margin-bottom: $-toast-icon-margin-bottom; margin-bottom: $-toast-icon-margin-bottom;
} }
} }
@ -67,6 +65,12 @@
min-width: $-toast-with-icon-min-width; min-width: $-toast-with-icon-min-width;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
@include me(msg) {
margin-left: $-toast-msg-margin-left;
@include when(vertical) {
margin-left: 0;
}
}
} }
@include m(loading) { @include m(loading) {
min-width: auto; min-width: auto;

View File

@ -26,7 +26,7 @@
:name="iconClass" :name="iconClass"
></wd-icon> ></wd-icon>
<!--文本--> <!--文本-->
<view v-if="msg" class="wd-toast__msg">{{ msg }}</view> <view v-if="msg" :class="`wd-toast__msg ${direction === 'vertical' ? 'is-vertical' : ''}`">{{ msg }}</view>
</view> </view>
</wd-transition> </wd-transition>
</template> </template>

View File

@ -3,13 +3,13 @@
<view class="wd-video-preview__video" @click.stop=""> <view class="wd-video-preview__video" @click.stop="">
<video <video
class="wd-video-preview__video" class="wd-video-preview__video"
v-if="previdewVideo.url" v-if="previewVideo.url"
:controls="true" :controls="true"
:poster="previdewVideo.poster" :poster="previewVideo.poster"
:title="previdewVideo.title" :title="previewVideo.title"
play-btn-position="center" play-btn-position="center"
:enableNative="true" :enableNative="true"
:src="previdewVideo.url" :src="previewVideo.url"
:enable-progress-gesture="false" :enable-progress-gesture="false"
></video> ></video>
</view> </view>
@ -36,13 +36,13 @@ import { useLockScroll } from '../composables/useLockScroll'
defineProps(videoPreviewProps) defineProps(videoPreviewProps)
const showPopup = ref<boolean>(false) const showPopup = ref<boolean>(false)
const previdewVideo = reactive<PreviewVideo>({ url: '', poster: '', title: '' }) const previewVideo = reactive<PreviewVideo>({ url: '', poster: '', title: '' })
function open(video: PreviewVideo) { function open(video: PreviewVideo) {
showPopup.value = true showPopup.value = true
previdewVideo.url = video.url previewVideo.url = video.url
previdewVideo.poster = video.poster previewVideo.poster = video.poster
previdewVideo.title = video.title previewVideo.title = video.title
} }
function close() { function close() {
@ -53,9 +53,9 @@ function close() {
} }
function handleClosed() { function handleClosed() {
previdewVideo.url = '' previewVideo.url = ''
previdewVideo.poster = '' previewVideo.poster = ''
previdewVideo.title = '' previewVideo.title = ''
} }
// #ifdef H5 // #ifdef H5