wechat-miniprogram / weui-miniprogram

小程序WeUI组件库
MIT License
2.21k stars 549 forks source link

使用useExtendedLib模式, page相关的class不起作用 #205

Closed Calvin-he closed 2 years ago

Calvin-he commented 2 years ago

Bug描述

使用useExtendedLib模式, page相关的class不起作用

复现方式

<view class="page">
    <view class="page__hd">
        <view class="page__title">Flex</view>
        <view class="page__desc">Flex布局</view>
    </view>
    <view class="page__hd">
        <view class="page__title">Button</view>
        <view class="page__desc">按钮</view>
    </view>
    <view class="page__bd">
        <view class="weui-btn-area">
            <view aria-role="button" class="weui-btn weui-btn_default" bindtap="openDefault">普通型</view>
            <view aria-role="button" class="weui-btn weui-btn_default" bindtap="openBottomfixed">底部悬浮型</view>
        </view>
    </view>
</view>

image

版本信息

Calvin-he commented 2 years ago

page相关的class不属于weui。 需要引入的话,可手动在app.wxss中加入如下代码:

page {
  height: 100%
}

.page {
  min-height: 100%;
  background-color: var(--weui-BG-0);
  color: var(--weui-FG-0);
  font-size: 32rpx;
  font-family: system-ui, -apple-system, Helvetica Neue, sans-serif
}

image {
  max-width: 100%;
  max-height: 100%
}

.link {
  display: inline;
  color: var(--weui-LINK)
}

.fadeIn {
  -webkit-animation: c .3s forwards;
  animation: c .3s forwards
}

.fadeOut {
  -webkit-animation: d .3s forwards;
  animation: d .3s forwards
}

@keyframes c {
  0% {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes d {
  0% {
    opacity: 1
  }

  to {
    opacity: 0
  }
}

.weui-msg__extra-area {
  position: static
}

.page__hd {
  padding: 80rpx
}

.page__bd {
  padding-bottom: 80rpx
}

.page__bd_spacing {
  padding-left: 30rpx;
  padding-right: 30rpx
}

.page__ft {
  padding-top: 80rpx;
  padding-bottom: 20rpx;
  padding-bottom: calc(20rpx + constant(safe-area-inset-bottom));
  padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  text-align: center
}

[data-weui-theme=dark] .page__ft image {
  -webkit-filter: invert(100) hue-rotate(180deg);
  filter: invert(100) hue-rotate(180deg)
}

.page__title {
  text-align: left;
  font-size: 40rpx;
  font-weight: 400
}

.page__desc {
  margin-top: 10rpx;
  color: var(--weui-FG-1);
  text-align: left;
  font-size: 28rpx
}
Calvin-he commented 2 years ago

page相关的class不属于weui。 需要引入的话,可手动在app.wxss中加入如下代码:

page {
  height: 100%
}

.page {
  min-height: 100%;
  background-color: var(--weui-BG-0);
  color: var(--weui-FG-0);
  font-size: 32rpx;
  font-family: system-ui, -apple-system, Helvetica Neue, sans-serif
}

image {
  max-width: 100%;
  max-height: 100%
}

.link {
  display: inline;
  color: var(--weui-LINK)
}

.fadeIn {
  -webkit-animation: c .3s forwards;
  animation: c .3s forwards
}

.fadeOut {
  -webkit-animation: d .3s forwards;
  animation: d .3s forwards
}

@keyframes c {
  0% {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes d {
  0% {
    opacity: 1
  }

  to {
    opacity: 0
  }
}

.weui-msg__extra-area {
  position: static
}

.page__hd {
  padding: 80rpx
}

.page__bd {
  padding-bottom: 80rpx
}

.page__bd_spacing {
  padding-left: 30rpx;
  padding-right: 30rpx
}

.page__ft {
  padding-top: 80rpx;
  padding-bottom: 20rpx;
  padding-bottom: calc(20rpx + constant(safe-area-inset-bottom));
  padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  text-align: center
}

[data-weui-theme=dark] .page__ft image {
  -webkit-filter: invert(100) hue-rotate(180deg);
  filter: invert(100) hue-rotate(180deg)
}

.page__title {
  text-align: left;
  font-size: 40rpx;
  font-weight: 400
}

.page__desc {
  margin-top: 10rpx;
  color: var(--weui-FG-1);
  text-align: left;
  font-size: 28rpx
}