forked from opentiny/tiny-vue
docs(anchor): Fix test sheets, optimize anchor component documentation (#1239)
This commit is contained in:
parent
0d966ad6cc
commit
723b07d0ee
|
@ -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'
|
||||
}
|
||||
])
|
||||
|
||||
|
|
|
@ -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')
|
||||
})
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
])
|
||||
|
||||
|
|
|
@ -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/)
|
||||
})
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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]'
|
||||
},
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
])
|
||||
|
||||
|
|
Loading…
Reference in New Issue