Taro.getExtConfig(option)
Gets the data field customized by the third-party platform.
Tips
- The compatibility of this API cannot be determined via
Taro.canIUse
currently. You need to figure out yourself whetherTaro.getExtConfig
exists and is compatible with the API.
Type
(option?: Option) => Promise<SuccessCallbackResult>
Parameters
Option
Property | Type | Required | Description |
---|---|---|---|
complete | (res: any) => void | No | The callback function used when the API call completed (always executed whether the call succeeds or fails) |
fail | (res: any) => void | No | The callback function for a failed API call |
success | (res: Result) => void | No | The callback function for a successful API call |
SuccessCallbackResult
Property | Type | Description |
---|---|---|
extConfig | Record<string, any> | Data customized by the third-party platform |
errMsg | string | Call result |
Sample Code
if(Taro.getExtConfig) {
Taro.getExtConfig({
success: function (res) {
console.log(res.extConfig)
}
})
}
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
Taro.getExtConfig | ✔️ |