|
20 | 20 | <div class="ti-rel cmp-container"> |
21 | 21 | <div class="flex-horizontal docs-content-main"> |
22 | 22 | <div class="docs-tabs-wrap"> |
23 | | - <tiny-tabs v-model="activeTab" ref="demoTabs" class="docs-content-tabs" @click="onTabsClick"> |
| 23 | + <div v-if="['interfaces', 'types', 'classes'].includes(cmpId)" id="TS" class="all-api-container"> |
| 24 | + <div class="ti-f-c ti-f-wrap api-list"> |
| 25 | + <div class="mt20" v-for="oneGroup in currJson.apis" :key="oneGroup.name"> |
| 26 | + <div class="ti-f-r ti-f-pos-start ti-fw-bold"> |
| 27 | + <div :id="`cmp-${oneGroup.name}`" class="ti-f18"> |
| 28 | + {{ oneGroup.name }} |
| 29 | + </div> |
| 30 | + <div class="ti-ml12 ti-b-a-primary ti-c-primary ti-px8 ti-py4"> |
| 31 | + {{ oneGroup.type }} |
| 32 | + </div> |
| 33 | + </div> |
| 34 | + <div v-for="(oneApiArr, key) in oneGroup" :key="key"> |
| 35 | + <template v-if="key !== 'name' && key !== 'type' && oneApiArr.length > 0"> |
| 36 | + <div class="ti-f18 ti-py28" :id="`${oneGroup.name}--${key}`"> |
| 37 | + {{ key }} |
| 38 | + </div> |
| 39 | + <div class="api-table-box"> |
| 40 | + <tiny-grid class="api-table" :data="tableData[oneGroup.name][key]" :expand-config="apiExpandConf"> |
| 41 | + <tiny-grid-column |
| 42 | + v-if="tableData[oneGroup.name][key][0]?.type" |
| 43 | + class-name="api-table-expand-col" |
| 44 | + type="expand" |
| 45 | + width="32" |
| 46 | + > |
| 47 | + <template #default="{ row }"> |
| 48 | + <async-highlight v-if="row.code" :code="row.code.trim()" types="ts"></async-highlight> |
| 49 | + </template> |
| 50 | + </tiny-grid-column> |
| 51 | + <tiny-grid-column field="name" :title="i18nByKey('name')" :width="columnWidth[key][0]"> |
| 52 | + <template #default="{ row }"> |
| 53 | + <span class="api-table-name"> |
| 54 | + <a v-if="row.demoId" @click="jumpToDemo(row.demoId)">{{ row.name }}</a> |
| 55 | + <span v-else>{{ row.name }}</span> |
| 56 | + </span> |
| 57 | + <version-tip |
| 58 | + v-if="row.meta || row.versionTipOption" |
| 59 | + :meta="row.meta" |
| 60 | + v-bind="row.versionTipOption" |
| 61 | + render-type="tag" |
| 62 | + tip-subject="api" |
| 63 | + > |
| 64 | + </version-tip> |
| 65 | + </template> |
| 66 | + </tiny-grid-column> |
| 67 | + <tiny-grid-column |
| 68 | + v-if="tableData[oneGroup.name][key][0]?.type" |
| 69 | + field="type" |
| 70 | + :title="i18nByKey('propType')" |
| 71 | + :width="columnWidth[key][1]" |
| 72 | + > |
| 73 | + <template #default="{ row }"> |
| 74 | + <a |
| 75 | + v-if="row.typeAnchorName" |
| 76 | + :href="`${row.typeAnchorName.indexOf('#') === -1 ? '#' : ''}${row.typeAnchorName}`" |
| 77 | + v-html="row.type" |
| 78 | + ></a> |
| 79 | + <span v-else v-html="row.type"></span> |
| 80 | + </template> |
| 81 | + </tiny-grid-column> |
| 82 | + <tiny-grid-column |
| 83 | + v-if="key === 'props'" |
| 84 | + field="defaultValue" |
| 85 | + :title="i18nByKey('defValue')" |
| 86 | + :width="columnWidth[key][2]" |
| 87 | + ></tiny-grid-column> |
| 88 | + <tiny-grid-column field="desc" :title="i18nByKey('desc')"> |
| 89 | + <template #default="data"> |
| 90 | + <span v-html="data.row.desc"></span> |
| 91 | + </template> |
| 92 | + </tiny-grid-column> |
| 93 | + </tiny-grid> |
| 94 | + </div> |
| 95 | + </template> |
| 96 | + </div> |
| 97 | + </div> |
| 98 | + </div> |
| 99 | + </div> |
| 100 | + <tiny-tabs v-else v-model="activeTab" ref="demoTabs" class="docs-content-tabs" @click="onTabsClick"> |
24 | 101 | <tiny-tab-item :title="i18nByKey('demos')" name="demos"> |
25 | 102 | <!-- demos列表 --> |
26 | 103 | <template v-if="currJson?.demos?.length"> |
|
0 commit comments