docs(date-picker): [date-picker] fix format docs (#1522)

This commit is contained in:
Kagol 2024-04-02 16:16:14 +08:00 committed by GitHub
parent 68c189bd65
commit 016bdb2795
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 5 deletions

View File

@ -62,8 +62,8 @@
</tr>
<tr v-else>
<th width="15%">{{ i18nByKey('name') }}</th>
<th width="20%">{{ i18nByKey('propType') }}</th>
<th width="20%">{{ i18nByKey('defValue') }}</th>
<th width="20%" v-if="hasKey(oneApiArr, 'type')">{{ i18nByKey('propType') }}</th>
<th width="20%" v-if="hasKey(oneApiArr, 'defaultValue')">{{ i18nByKey('defValue') }}</th>
<th width="45%">{{ i18nByKey('desc') }}</th>
</tr>
</thead>
@ -81,7 +81,7 @@
>
</version-tip>
</td>
<td v-if="!key.includes('slots')" @click="handleTypeClick">
<td v-if="!key.includes('slots') && hasKey(oneApiArr, 'type')" @click="handleTypeClick">
<a
v-if="row.typeAnchorName"
:href="`${row.typeAnchorName.indexOf('#') === -1 ? '#' : ''}${row.typeAnchorName}`"
@ -89,7 +89,14 @@
></a>
<span v-else v-html="row.type"></span>
</td>
<td v-if="!key.includes('slots') && !key.includes('events') && !key.includes('methods')">
<td
v-if="
!key.includes('slots') &&
!key.includes('events') &&
!key.includes('methods') &&
hasKey(oneApiArr, 'defaultValue')
"
>
<span
v-html="typeof row.defaultValue === 'string' ? row.defaultValue || '--' : row.defaultValue"
></span>
@ -412,6 +419,8 @@ export default defineComponent({
common.renderFooter()
})
const hasKey = (apiArr, key) => !apiArr.every((item) => item[key] === undefined)
return {
...toRefs(state),
...fn,
@ -419,7 +428,8 @@ export default defineComponent({
anchorRefreshKey,
apiModeState,
templateModeState,
optionsList
optionsList,
hasKey
}
}
})