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

页面文件支持config #10348

Closed
bingtsingw opened this issue Sep 26, 2021 · 1 comment
Closed

页面文件支持config #10348

bingtsingw opened this issue Sep 26, 2021 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@bingtsingw
Copy link
Contributor

bingtsingw commented Sep 26, 2021

这个特性解决了什么问题?

每个页面都要单独一个page.config.ts文件

这个 API 长什么样?

在页面函数的静态属性上配置config

function Index() {
  return (
      <View className='index'>
        <Text>1</Text>
      </View>
    )
}

Index.config = {
    navigationBarBackgroundColor: '#ffffff',
    navigationBarTextStyle: 'black',
    navigationBarTitleText: '首页',
    backgroundColor: '#eeeeee',
    backgroundTextStyle: 'light'
}

export default Index

相关issue

#7062
#9824
#7937

以前的版本好像支持过这个特性
#3054 (comment)

@Chen-jj
Copy link
Contributor

Chen-jj commented Dec 26, 2021

Taro v3.4 开始支持,新增两个编译时宏函数,文档:

@Chen-jj Chen-jj closed this as completed Dec 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants