diff --git a/docs/apis/alipay/getOpenUserInfo.md b/docs/apis/alipay/getOpenUserInfo.md new file mode 100644 index 000000000000..10abd649f9a1 --- /dev/null +++ b/docs/apis/alipay/getOpenUserInfo.md @@ -0,0 +1,14 @@ +--- +title: Taro.getOpenUserInfo() +sidebar_label: getOpenUserInfo +--- + +此接口可获取支付宝会员的基础信息 + +> 最低版本: 10.1.35(支付宝小程序) + +## 类型 + +```typescript +() => Promise +``` diff --git a/packages/taro/scripts/docs-api.ts b/packages/taro/scripts/docs-api.ts index 6ce149187f50..30125de10aad 100644 --- a/packages/taro/scripts/docs-api.ts +++ b/packages/taro/scripts/docs-api.ts @@ -114,8 +114,10 @@ export function writeDoc (routepath: string, doc: DocEntry[]) { '' ] e.documentation && md.push(e.documentation, '') - e.type && md.push('## 类型', '```typescript', e.type, '```', '') - parameters.length && md.push('## 参数') + const since = tags.find(tag => tag.name === 'since') + since && md.push(`> 最低版本: ${since.text || ''}`, '') + e.type && md.push('## 类型', '', '```typescript', e.type, '```', '') + parameters.length && md.push('## 参数', '') parameters.map(p => { const arr = p.members || p.exports || [] const hasType = arr.some(v => !!v.type && v.type !== p.name) @@ -144,10 +146,10 @@ export function writeDoc (routepath: string, doc: DocEntry[]) { example && md.push('## 示例代码', '', example.text || '', '') const supported = tags.find(tag => tag.name === 'supported') const apis = getAPI(name, supported && supported.text) - apis && md.push('## API 支持度', ...apis, + apis.length > 0 && md.push('## API 支持度', '', ...apis, '') const see = tags.find(tag => tag.name === 'see') - see && md.push('', `> [参考文档](${see.text || ''})`, '') + see && md.push(`> [参考文档](${see.text || ''})`, '') // md.push(JSON.stringify(e, undefined, 2)) fs.writeFileSync( diff --git a/packages/taro/types/api/alipay/index.d.ts b/packages/taro/types/api/alipay/index.d.ts index 6f62adf66540..27a3a4b06af7 100644 --- a/packages/taro/types/api/alipay/index.d.ts +++ b/packages/taro/types/api/alipay/index.d.ts @@ -1,7 +1,7 @@ declare namespace Taro { /** * 此接口可获取支付宝会员的基础信息 - * @since 10.1.35 + * @since 10.1.35(支付宝小程序) */ function getOpenUserInfo(): Promise }