fix(sites): fix api table link error (#754)
* fix(sites): fix api table link error * fix(sites): fix api table link error * fix(sites): fix api table link error
This commit is contained in:
parent
949eb49b87
commit
b7b845efcf
|
@ -32,7 +32,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="currJson.apis?.length > 0">
|
<template v-if="currJson.apis?.length > 0">
|
||||||
<div id="API" @click="handleApiClick($event)">
|
<div id="API">
|
||||||
<h2 class="ti-f30 ti-fw-normal ti-mt28">API</h2>
|
<h2 class="ti-f30 ti-fw-normal ti-mt28">API</h2>
|
||||||
<!-- apis 是一个数组 {name,type,properties:[原table内容],events:[] ...........} -->
|
<!-- apis 是一个数组 {name,type,properties:[原table内容],events:[] ...........} -->
|
||||||
<div class="mt20" v-for="(oneGroup, idx) in currJson.apis" :key="oneGroup.name">
|
<div class="mt20" v-for="(oneGroup, idx) in currJson.apis" :key="oneGroup.name">
|
||||||
|
@ -313,16 +313,8 @@ export default defineComponent({
|
||||||
} else {
|
} else {
|
||||||
router.push(`#${demoId}`)
|
router.push(`#${demoId}`)
|
||||||
}
|
}
|
||||||
},
|
if (apiModeState.demoMode === 'single') {
|
||||||
handleApiClick: (ev) => {
|
state.singleDemo = state.currJson.demos.find((d) => d.demoId === demoId)
|
||||||
if (ev.target.tagName === 'A') {
|
|
||||||
ev.preventDefault()
|
|
||||||
const href = ev.target.getAttribute('href')
|
|
||||||
const hash = $split(href, '#', -1)
|
|
||||||
router.push(href)
|
|
||||||
state.singleDemo = state.currJson.demos.find((d) => d.demoId === hash)
|
|
||||||
|
|
||||||
scrollByHash(hash)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleTypeClick: (ev) => {
|
handleTypeClick: (ev) => {
|
||||||
|
|
Loading…
Reference in New Issue