-
zhangwei
2025-03-05 16213c0f85aa3ac8317797bf4a05fd12940e16d3
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;