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

v1.3.0-beta.2 百度小程序自定义组件 iconfont 不显示 #3090

Closed
Shalhvi opened this issue May 18, 2019 · 13 comments
Closed

v1.3.0-beta.2 百度小程序自定义组件 iconfont 不显示 #3090

Shalhvi opened this issue May 18, 2019 · 13 comments
Assignees

Comments

@Shalhvi
Copy link

Shalhvi commented May 18, 2019

问题描述
v1.3.0-beta.2 百度小程序自定义组件 iconfont不显示,微信小程序显示正常

复现步骤

// app.ts
import './font/iconfont.scss'
// 父组件
import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import { IProps, IState } from './type'
import './style.scss'

import { ComponentClass } from 'react'

import FloatingBtn from '../../components/FloatingBtn'

class Test extends Component<IProps, IState> {
  constructor(props: IProps) {
    super(props)
  }

  static options = {
    addGlobalClass: true
  }

  render() {
    return (
      <View className='test'>
        <FloatingBtn  />
      </View>
    )
  }
}

export default Test as ComponentClass<IProps, IState>
// 子组件
import { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import { IProps, IState } from './type'
import './style.scss'

export default class extends Component<IProps, IState> {
  constructor(props: IProps) {
    super(props)
  }

  static options = {
    addGlobalClass: true
  }

  render() {
    return (
      <View className='iconfont icon-btn_hyh'>
    )
  }
}

期望行为
百度小程序自定义组件显示iconfont

报错信息

系统信息
👽 Taro v1.3.0-beta.2
Taro CLI 1.3.0-beta.2 environment info:
System:
OS: macOS High Sierra 10.13.6
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 5.6.0 - ~/.nvm/versions/node/v8.11.3/bin/npm

  • 报错平台 [swan]
@taro-bot
Copy link

taro-bot bot commented May 18, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@Chen-jj
Copy link
Contributor

Chen-jj commented May 27, 2019

@Shalhvi v1.3.0-beta5 测试正常,升级后再试试吧。

App.js

import './font/iconfont.css'

页面:

import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import A from '../../components/a/a'

export default class Detail extends Component {
  render () {
    return (
      <View className='index'>
        <A />
      </View>
    )
  }
}

组件:

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

export default class A extends Component {
  static options = {
    addGlobalClass: true
  }
  render() {
    return <View className='iconfont iconfont-left-circle' style='font-size: 24px;' />
  }
}

image

@taro-bot
Copy link

taro-bot bot commented May 27, 2019

Hello~

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

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

Good luck and happy coding~

@cuikangyi
Copy link
Contributor

cuikangyi commented May 27, 2019

我也遇到这个问题
👽 Taro v1.3.0-beta.5
Taro CLI 1.3.0-beta.5 environment info:
System:
OS: Windows 10
Binaries:
Node: 10.15.3
Yarn: 1.16.0
npm: 6.9.0

批注 2019-05-27 150948
批注 2019-05-27 151132

不知道是不是百度开发工具的问题,懒得写原生的demo测试

@skymoonya
Copy link

image
image
一样的问题,但是在微信开发者工具中是ok的

@Chen-jj
Copy link
Contributor

Chen-jj commented May 28, 2019

@ckytx @skymoonya 提供一个完整可复现的项目 demo 我测试下吧。

@cuikangyi
Copy link
Contributor

@Chen-jj
test.zip
工具上无法显示,但是手机端预览正常,dist没删除是我本地编译好的
可以看我之前截图,组件里的class没有全局的class名

@skymoonya
Copy link

c-mini-program.tar.gz
@Chen-jj 和 @ckytx 不同的是我在手机端预览也有问题

@Chen-jj
Copy link
Contributor

Chen-jj commented May 30, 2019

#3239

@Chen-jj
Copy link
Contributor

Chen-jj commented May 30, 2019

@ckytx @skymoonya 等百度开发者工具下一个版本再试试。

@skymoonya
Copy link

@ckytx @skymoonya 等百度开发者工具下一个版本再试试。

了解

@cuikangyi
Copy link
Contributor

cuikangyi commented May 31, 2019

@ckytx @skymoonya 等百度开发者工具下一个版本再试试。

百度更新了开发工具2.2.7,可以显示了,谢谢了

@Chen-jj
Copy link
Contributor

Chen-jj commented May 31, 2019

@Shalhvi @skymoonya @ckytx 百度开发者工具,基础库改为 3.60.16 即可。

@Chen-jj Chen-jj closed this as completed May 31, 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

4 participants