From ec90cbd7680a6f927cb1cea43f33ab7df6d0864c Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期二, 11 十一月 2025 09:23:22 +0800
Subject: [PATCH] -
---
src/uni_modules/uview-plus/components/u-toolbar/u-toolbar.vue | 56 ++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 38 insertions(+), 18 deletions(-)
diff --git a/src/uni_modules/uview-plus/components/u-toolbar/u-toolbar.vue b/src/uni_modules/uview-plus/components/u-toolbar/u-toolbar.vue
index 905345d..68e9f36 100644
--- a/src/uni_modules/uview-plus/components/u-toolbar/u-toolbar.vue
+++ b/src/uni_modules/uview-plus/components/u-toolbar/u-toolbar.vue
@@ -5,32 +5,45 @@
v-if="show"
>
<view
- class="u-toolbar__cancel__wrapper"
- hover-class="u-hover-class"
+ class="u-toolbar__left"
>
- <text
- class="u-toolbar__wrapper__cancel"
- @tap="cancel"
- :style="{
- color: cancelColor
- }"
- >{{ cancelText }}</text>
+ <view
+ class="u-toolbar__cancel__wrapper"
+ hover-class="u-hover-class"
+ >
+ <text
+ class="u-toolbar__wrapper__cancel"
+ @tap="cancel"
+ :style="{
+ color: cancelColor
+ }"
+ >{{ cancelText }}</text>
+ </view>
</view>
<text
class="u-toolbar__title u-line-1"
v-if="title"
>{{ title }}</text>
<view
- class="u-toolbar__confirm__wrapper"
- hover-class="u-hover-class"
+ class="u-toolbar__right"
>
- <text
- class="u-toolbar__wrapper__confirm"
- @tap="confirm"
- :style="{
- color: confirmColor
- }"
- >{{ confirmText }}</text>
+ <view
+ v-if="!rightSlot"
+ class="u-toolbar__confirm__wrapper"
+ hover-class="u-hover-class"
+ >
+ <text
+ class="u-toolbar__wrapper__confirm"
+ @tap="confirm"
+ :style="{
+ color: confirmColor
+ }"
+ >{{ confirmText }}</text>
+ </view>
+ <template v-else>
+ <slot name="right">
+ </slot>
+ </template>
</view>
</view>
</template>
@@ -56,6 +69,9 @@
name: 'u-toolbar',
mixins: [mpMixin, mixin, props],
emits: ["confirm", "cancel"],
+ created() {
+ // console.log(this.$slots)
+ },
methods: {
// 鐐瑰嚮鍙栨秷鎸夐挳
cancel() {
@@ -95,6 +111,10 @@
}
&__wrapper {
+ &__left,
+ &__right {
+ @include flex;
+ }
&__confirm {
color: $u-primary;
font-size: 15px;
--
Gitblit v1.9.1