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

文档: 微信小程序自定义编译配置在官方文档找不到 #8928

Closed
yangger6 opened this issue Mar 16, 2021 · 4 comments
Closed

文档: 微信小程序自定义编译配置在官方文档找不到 #8928

yangger6 opened this issue Mar 16, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@yangger6
Copy link

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

使用者可根据需求自定义配置微信小程序的编译模式

这个 API 长什么样?

官方文档没有找到 (可能是我瞎了) ,但是实际是可以用的, 希望可以在官网展示出来

使用方法

// package.config.json
{
"condition": {
        "miniprogram": {
            "current": -1,
            "list": [
                {
                    "id": 0,
                    "name": "购物车",
                    "pathName": "pages/shopCart/index",
                    "query": "orderId=xxxx",
                    "scene": null
                }
            ]
        }
    }
}
@taro-bot2 taro-bot2 bot added the enhancement New feature or request label Mar 16, 2021
@Chen-jj
Copy link
Contributor

Chen-jj commented Mar 16, 2021

麻烦提供一下对应小程序的文档地址

@yangger6
Copy link
Author

麻烦提供一下对应小程序的文档地址

微信官网condition配置项我也没找到文档地址,目前是配置在project.private.config.json里,因为之前用taro2转码原生小程序的时候生成了这些配置项,得知Taro支持这样用,所以在想,这个功能放在taro的文档上对有需要的开发者是不是有些帮助~

@iamxiyang
Copy link

看了一下,微信的文档似乎确实没有。但

uni的文档有:https://uniapp.dcloud.io/collocation/pages?id=condition
微信开发者社区也有类似讨论:https://developers.weixin.qq.com/community/develop/doc/0008e2ef6bc870d9ac3beedb451000?highLine=condition
在微信开发者工具打开小程序后 package.config.json 、 project.private.config.json 中也会自动出现 condition 这些字段。

@Chen-jj
Copy link
Contributor

Chen-jj commented Apr 25, 2021

Taro 对小程序配置文件的内容不作处理,只是规定了不同平台的配置文件有不同的命名规则,配置项直接参考小程序官方文档。

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

3 participants