Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

开启css module后 绑定类无效 #4087

Closed
CalmHarbin opened this issue Aug 6, 2019 · 6 comments
Closed

开启css module后 绑定类无效 #4087

CalmHarbin opened this issue Aug 6, 2019 · 6 comments

Comments

@CalmHarbin
Copy link

问题描述
[问题描述:开启css module后类绑定应使用class,不能用className

复现步骤
[复现问题的步骤]

import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'

import styles from './Test.module.scss'

export default class Test extends Component {
  constructor(props) {
    super(props)
    this.state = { }
  }

  render () {
    return (
     {/*这里使用class正常,使用className异常*/}
      <View class={styles.test}>
        <Text class={styles.txt}>Hello world!</Text>
      </View>
    )
  }
}

期望行为
使用className也能是正确的渲染样式

报错信息

无报错信息

系统信息

Taro v1.2 及以上版本已添加 taro info 命令,方便大家查看系统及依赖信息,运行该命令后将结果贴下面即可。

  • 操作系统: Windows 10
  • Taro 版本 [e.g. v.1.3.11]
  • Node.js 版本 [e.g. v10.15.3]
  • 报错平台 [weapp]

补充信息
[可选]
转换wxml的时候未将className替换为class

@taro-bot
Copy link

taro-bot bot commented Aug 6, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@yuche
Copy link
Contributor

yuche commented Aug 12, 2019

麻烦做成一个带有 package.json 的仓库,单单这个代码片段无法复现

@luckyadam
Copy link
Member

确实没有复现,提供一个完整的 demo 吧

@taro-bot
Copy link

taro-bot bot commented Aug 12, 2019

Hello~

您的问题我们无法复现。如果有空的话还请拔冗提供一个简单的复现 demo,否则这个 issue 将在 15 天后被自动关闭。

如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。

Good luck and happy coding~

@CalmHarbin
Copy link
Author

麻烦做成一个带有 package.json 的仓库,单单这个代码片段无法复现

已经做了一个demo
仓库地址

image
image

@CalmHarbin
Copy link
Author

👽 Taro v1.3.13

Taro CLI 1.3.13 environment info:
System:
OS: Windows 10
Binaries:
Node: 10.15.3 - D:\Win10\node\node.EXE
npm: 6.4.1 - D:\Win10\node\npm.CMD

@taro-bot taro-bot bot removed the to be closed label Aug 27, 2019
@taro-bot taro-bot bot closed this as completed Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants