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

@ -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'
}
])