Skip to content

uni-swipe-action-item生产环境类名丢失 #732

Open
@yaomk

Description

@yaomk
  • 问题描述:uni-swipe-action-item 设置 class 类名 swipe-item-f,开发环境样式正常,打包后类名丢失。
  • uni-swipe-action 版本:1.3.7
  • 版本构建相关:"vue": "^3.2.45", "vite": "4.1.4"
  • 项目构建方式:npx degit dcloudio/uni-preset-vue#vite my-vue3-project
  • 运行环境:h5
  • 代码示例:
<template>
  <view class="content">
    <view class="text-area">
      <text class="title">{{ title }}</text>
    </view>
    <uni-swipe-action class="swipe-action-content">
      <!-- 使用插槽 (请自行给定插槽内容宽度)-->
      <uni-swipe-action-item class="swipe-item-f">
        <view>
          <text>使用插槽</text>
        </view>
        <template #right>
          <view style="margin-left: 10rpx;"><text style="color: red;">删除</text></view>
        </template>
      </uni-swipe-action-item>
    </uni-swipe-action>
  </view>
</template>

<script>
export default {
  data() {
    return {
      title: 'Hello',
    }
  },
  onLoad() { },
  methods: { },
}
</script>

<style lang="scss" scoped>
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.text-area {
  display: flex;
  justify-content: center;
}

.title {
  font-size: 36rpx;
  color: #8f8f94;
}

.swipe-action-content {
  width: 100%;
  height: 50rpx;
  background-color: #f3f3f3;
  .swipe-item-f {
    color: aqua;
  }
}
</style>
  • 开发环境,类名生效
    开发环境

  • 打包后查看,类名丢失,静态资源里有返回
    生产环境
    打包后静态资源

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions