docs(anchor): Fix test sheets, optimize anchor component documentation (#1239)

This commit is contained in:
chenxi-20 2024-01-02 20:02:46 +08:00 committed by GitHub
parent 0d966ad6cc
commit 723b07d0ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 58 additions and 58 deletions

View File

@ -19,29 +19,29 @@ const links = ref([
{
key: 'basic-usage',
link: '#basic-usage',
title: 'Basic Usage'
title: '基本用法'
},
{
key: 'is-affix',
link: '#is-affix',
title: 'Is Affix'
title: '固定模式'
},
{
key: 'set-container',
link: '#set-container',
title: 'Set Container'
title: '滚动容器'
},
{
key: 'on-change',
link: '#on-change',
title: 'On Change'
link: '#change',
title: 'change 事件'
}
]
},
{
key: 'api',
link: '#api',
title: 'Api'
link: '#API',
title: 'API'
}
])

View File

@ -6,7 +6,7 @@ test('基本用法', async ({ page }) => {
const anchor = page.locator('.tiny-anchor')
const link1 = anchor.getByRole('link', { name: '演示' })
const link2 = anchor.getByRole('link', { name: 'On Change' })
const link2 = anchor.getByRole('link', { name: 'change 事件' })
const hash1 = await page.evaluate(() => window.location.hash)
await link1.click()
@ -18,5 +18,5 @@ test('基本用法', async ({ page }) => {
await link2.click()
const hash3 = await page.evaluate(() => window.location.hash)
await expect(hash3).toContain('#on-change')
await expect(hash3).toContain('#change')
})

View File

@ -27,29 +27,29 @@ export default {
{
key: 'basic-usage',
link: '#basic-usage',
title: 'Basic Usage'
title: '基本用法'
},
{
key: 'is-affix',
link: '#is-affix',
title: 'Is Affix'
title: '固定模式'
},
{
key: 'set-container',
link: '#set-container',
title: 'Set Container'
title: '滚动容器'
},
{
key: 'on-change',
link: '#on-change',
title: 'On Change'
link: '#change',
title: 'change 事件'
}
]
},
{
key: 'api',
link: '#api',
title: 'Api'
link: '#API',
title: 'API'
}
],
type: 'dot'

View File

@ -15,29 +15,29 @@ const links = ref([
{
key: 'basic-usage',
link: '#basic-usage',
title: 'Basic Usage'
title: '基本用法'
},
{
key: 'is-affix',
link: '#is-affix',
title: 'Is Affix'
title: '固定模式'
},
{
key: 'set-container',
link: '#set-container',
title: 'Set Container'
title: '滚动容器'
},
{
key: 'on-change',
link: '#on-change',
title: 'On Change'
link: '#change',
title: 'change 事件'
}
]
},
{
key: 'api',
link: '#api',
title: 'Api'
link: '#API',
title: 'API'
}
])

View File

@ -6,12 +6,12 @@ test('change事件', async ({ page }) => {
const anchor = page.locator('.tiny-anchor')
const link1 = anchor.getByRole('link', { name: '演示' })
const link2 = anchor.getByRole('link', { name: 'On Change' })
const link2 = anchor.getByRole('link', { name: 'change 事件' })
const modal = page.locator('.tiny-modal')
await link1.click()
await expect(modal).toHaveCount(1)
await link2.click()
await expect(modal).toHaveCount(2)
await expect(modal.last()).toHaveText(/#on-change/)
await expect(modal.last()).toHaveText(/#change/)
})

View File

@ -20,29 +20,29 @@ export default {
{
key: 'basic-usage',
link: '#basic-usage',
title: 'Basic Usage'
title: '基本用法'
},
{
key: 'is-affix',
link: '#is-affix',
title: 'Is Affix'
title: '固定模式'
},
{
key: 'set-container',
link: '#set-container',
title: 'Set Container'
title: '滚动容器'
},
{
key: 'on-change',
link: '#on-change',
title: 'On Change'
link: '#change',
title: 'change 事件'
}
]
},
{
key: 'api',
link: '#api',
title: 'Api'
link: '#API',
title: 'API'
}
]
}

View File

@ -22,29 +22,29 @@ const links = ref([
{
key: 'basic-usage',
link: '#basic-usage',
title: 'Basic Usage'
title: '基本用法'
},
{
key: 'is-affix',
link: '#is-affix',
title: 'Is Affix'
title: '固定模式'
},
{
key: 'set-container',
link: '#set-container',
title: 'Set Container'
title: '滚动容器'
},
{
key: 'on-change',
link: '#on-change',
title: 'On Change'
link: '#change',
title: 'change 事件'
}
]
},
{
key: 'api',
link: '#api',
title: 'Api'
link: '#API',
title: 'API'
}
])
</script>

View File

@ -28,29 +28,29 @@ export default {
{
key: 'basic-usage',
link: '#basic-usage',
title: 'Basic Usage'
title: '基本用法'
},
{
key: 'is-affix',
link: '#is-affix',
title: 'Is Affix'
title: '固定模式'
},
{
key: 'set-container',
link: '#set-container',
title: 'Set Container'
title: '滚动容器'
},
{
key: 'on-change',
link: '#on-change',
title: 'On Change'
link: '#change',
title: 'change 事件'
}
]
},
{
key: 'api',
link: '#api',
title: 'Api'
link: '#API',
title: 'API'
}
]
}

View File

@ -52,7 +52,7 @@ export default {
'defaultValue': '',
'desc': {
'zh-CN':
'用于单页面 hash 路由模式时指定滚动容器的id值id为空时则滚动容器默认为 HTML 文档的根节点 body 元素',
'用于单页面 hash 路由模式时指定滚动容器的 id id 为空时则滚动容器默认为 HTML 文档的根节点 body 元素',
'en-US':
'When used in single page hash routing mode, specify the id value of the scrolling container. If the id is empty, the scrolling container defaults to the body element of the root node of the HTML document'
},
@ -71,7 +71,7 @@ export default {
'typeAnchorName': 'ILink',
'defaultValue': '',
'desc': {
'zh-CN': '导航数据配置项,可通过children嵌套',
'zh-CN': '导航数据配置项,可通过 children 嵌套',
'en-US': 'Navigation data configuration items can be nested through children'
},
'demoId': 'basic-usage'
@ -113,7 +113,7 @@ export default {
'type': '(hash: string) => void',
'defaultValue': '',
'desc': {
'zh-CN': '使用change代替[deprecated v3.12.0废弃v3.17.0移除;移除原因:命名规范]',
'zh-CN': '使用 change 代替;[deprecated v3.12.0 废弃v3.17.0 移除;移除原因:命名规范]',
'en-US':
'use change instead [deprecated v3.12.0 abandoned, v3.17.0 removed; reason for removal: naming convention]'
},

View File

@ -1,7 +1,7 @@
<template>
<div>
<tiny-button @click="handleClick(!showNum)" style="max-width: unset"
>设置 show-number 值为{{ !showNum }}</tiny-button
>设置 show-number 值为 {{ !showNum }}</tiny-button
>
<tiny-milestone
:data="milestoneData"

View File

@ -1,7 +1,7 @@
<template>
<div>
<tiny-button @click="handleClick(!showNum)" style="max-width: unset"
>设置 show-number 值为{{ !showNum }}</tiny-button
>设置 show-number 值为 {{ !showNum }}</tiny-button
>
<tiny-milestone
:data="milestoneData"

View File

@ -11,29 +11,29 @@ const links = reactive([
{
key: 'basic-usage',
link: '#basic-usage',
title: 'Basic Usage'
title: '基本用法'
},
{
key: 'is-affix',
link: '#is-affix',
title: 'Is Affix'
title: '固定模式'
},
{
key: 'set-container',
link: '#set-container',
title: 'Set Container'
title: '滚动容器'
},
{
key: 'on-change',
link: '#on-change',
title: 'On Change'
link: '#change',
title: 'change 事件'
}
]
},
{
key: 'api',
link: '#api',
title: 'Api'
link: '#API',
title: 'API'
}
])