Skip to content

Commit

Permalink
fix(vue-renderless): [breadcrumb, bulletin-board, button, button-grou…
Browse files Browse the repository at this point in the history
…p] fix site: Optimize site documentation typesetting
  • Loading branch information
dufu1991 committed Dec 27, 2024
1 parent bb2ada5 commit c15edf5
Show file tree
Hide file tree
Showing 21 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/breadcrumb/base.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test('Breadcrumb 基础用法', async ({ page }) => {
const currentItem = breadcrumbItem.last()
const separator = page.locator('.tiny-breadcrumb__separator')

// 面包屑导航、导航项出现,当前页导航加粗
// 面包屑导航、导航项出现当前页导航加粗
await expect(breadcrumb).toBeVisible()
await expect(breadcrumbItem).toHaveCount(3)
await expect(currentItem.last().locator('.is-link')).toHaveCSS('font-weight', '600')
Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/breadcrumb/options.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test'

test('Breadcrumb options配置', async ({ page }) => {
test('Breadcrumb options 配置', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('breadcrumb#options')

Expand All @@ -9,7 +9,7 @@ test('Breadcrumb options配置', async ({ page }) => {
const currentItem = breadcrumbItem.last()
const separator = breadcrumb.locator('.tiny-breadcrumb__separator')

// 面包屑导航、导航项出现,当前页导航加粗
// 面包屑导航、导航项出现当前页导航加粗
await expect(breadcrumb).toBeVisible()
await expect(breadcrumbItem).toHaveCount(3)
await expect(currentItem.last().getByRole('link')).toHaveCSS('font-weight', '600')
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/breadcrumb/size.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test('Breadcrumb 尺寸设置', async ({ page }) => {
const currentItem = breadcrumbItem.last()
const separator = page.locator('.tiny-breadcrumb__separator')

// 面包屑导航、导航项出现,当前页导航加粗
// 面包屑导航、导航项出现当前页导航加粗
await expect(breadcrumb).toBeVisible()
await expect(breadcrumbItem).toHaveCount(3)
await expect(currentItem.last().locator('.is-link')).toHaveCSS('font-weight', '600')
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/bulletin-board/events.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ test('测试点击事件', async ({ page }) => {
const modal = page.locator('.tiny-modal')

await demo.getByRole('link', { name: 'TINY v2.1.3 版本' }).click()
await expect(modal.getByText('click 事件:内容为TINY v2.1.3 版本')).toBeVisible()
await expect(modal.getByText('click 事件:内容为 TINY v2.1.3 版本')).toBeVisible()
})
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test'

test('BulletinBoard 显示 “更多” 链接(', async ({ page }) => {
test('BulletinBoard 显示“更多”链接 (', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('bulletin-board#more-link')

Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/bulletin-board/route.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { test, expect } from '@playwright/test'

test('BulletinBoard 基于Route的跳转', async ({ page }) => {
test('BulletinBoard 基于 Route 的跳转', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('bulletin-board#route')

const preview = page.locator('#route')
const contentTitle = preview.locator('.tiny-bulletin-board__textTitle')

// 判断a标签href属性值
// 判断 a 标签 href 属性值
await expect(contentTitle).toHaveAttribute('href', '/#/Alert')
})
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test'

test('BulletinBoard 选项卡标题(', async ({ page }) => {
test('BulletinBoard 选项卡标题 (', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('bulletin-board#tab-title')

Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/bulletin-board/title.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test'

test('BulletinBoard 公告牌标题(', async ({ page }) => {
test('BulletinBoard 公告牌标题 (', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('bulletin-board#title')

Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/bulletin-board/url.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { test, expect } from '@playwright/test'

test('BulletinBoard 基于Url的跳转', async ({ page }) => {
test('BulletinBoard 基于 Url 的跳转', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('bulletin-board#url')

const preview = page.locator('#url')
const contentTitle = preview.locator('.tiny-bulletin-board__textTitle')

// a标签href属性值
// a 标签 href 属性值
await expect(contentTitle).toHaveAttribute('href', 'localhost:3000/#/webcore/zh-CN/guide/changelog')
})
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {
{
demoId: 'url',
name: {
'zh-CN': '基于Url的跳转',
'zh-CN': '基于 Url 的跳转',
'en-US': 'URL-based redirection'
},
desc: {
Expand All @@ -70,7 +70,7 @@ export default {
{
demoId: 'route',
name: {
'zh-CN': '基于Route的跳转',
'zh-CN': '基于 Route 的跳转',
'en-US': 'Route-based redirection'
},
desc: {
Expand All @@ -82,7 +82,7 @@ export default {
{
demoId: 'more-link',
name: {
'zh-CN': '显示 “更多” 链接',
'zh-CN': '显示“更多”链接',
'en-US': 'Show More links'
},
desc: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ const groupData = ref([
])
function handleChange(val) {
TinyModal.message({ message: `change事件触发了,选中值为${val}`, status: 'info' })
TinyModal.message({ message: `change 事件触发了,选中值为 ${val}`, status: 'info' })
}
</script>
6 changes: 3 additions & 3 deletions examples/sites/demos/pc/app/button-group/change-event.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test'

test('按钮组change事件', async ({ page }) => {
test('按钮组 change 事件', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('button-group#change-event')

Expand All @@ -9,7 +9,7 @@ test('按钮组change事件', async ({ page }) => {
const modal = page.locator('.tiny-modal')

await btn.nth(1).click()
await expect(modal.filter({ hasText: 'change事件触发了,选中值为Button2' })).toBeVisible()
await expect(modal.filter({ hasText: 'change 事件触发了,选中值为 Button2' })).toBeVisible()
await btn.nth(2).click()
await expect(modal.filter({ hasText: 'change事件触发了,选中值为Button3' })).toBeVisible()
await expect(modal.filter({ hasText: 'change 事件触发了,选中值为 Button3' })).toBeVisible()
})
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/button-group/change-event.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
},
methods: {
handleChange(val) {
TinyModal.message({ message: `change事件触发了,选中值为${val}`, status: 'info' })
TinyModal.message({ message: `change 事件触发了,选中值为 ${val}`, status: 'info' })
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const groupData = ref([
const disabledGroup = ref([
{ text: 'Button1', value: 1 },
{ text: 'Button2', value: 2, disabled: true, tip: '因为xxx原因被禁用' },
{ text: 'Button2', value: 2, disabled: true, tip: '因为 xxx 原因被禁用' },
{ text: 'Button3', value: 3 }
])
</script>
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/button-group/disabled.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ test('测试按钮是否禁用', async ({ page }) => {

// 按钮悬浮提示
await buttonGroup3.locator('button').nth(1).hover()
await expect(page.getByText('因为xxx原因被禁用')).toBeVisible()
await expect(page.getByText('因为 xxx 原因被禁用')).toBeVisible()
})
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/button-group/disabled.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default {
],
disabledGroup: [
{ text: 'Button1', value: 1 },
{ text: 'Button2', value: 2, disabled: true, tip: '因为xxx原因被禁用' },
{ text: 'Button2', value: 2, disabled: true, tip: '因为 xxx 原因被禁用' },
{ text: 'Button3', value: 3 }
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const groupData = ref([
value: 'Button3',
sup: {
class: 'sup-text',
text: '8折'
text: '8 折'
}
},
{
Expand All @@ -64,7 +64,7 @@ const groupData = ref([
sup: {
slot: 'button4',
class: 'sup-slot',
text: '8折'
text: '8 折'
}
}
])
Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/button-group/sup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ test('测试选块角标', async ({ page }) => {

// 测试文字角标
const sup3 = getSup(item.nth(2))
await expect(sup3).toHaveText('8折')
await expect(sup3).toHaveText('8 折')
await expect(sup3).toHaveClass(/tiny-group-item__sup-text/)

// 测试自定义角标
const sup4 = getSup(item.nth(3))
await expect(sup4.locator('svg')).toBeVisible()
await expect(sup4).toHaveText('8折')
await expect(sup4).toHaveText('8 折')
await expect(sup4).toHaveClass(/sup-slot/)
})
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/button-group/sup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default {
value: 'Button3',
sup: {
class: 'sup-text',
text: '8折'
text: '8 折'
}
},
{
Expand All @@ -71,7 +71,7 @@ export default {
sup: {
slot: 'button4',
class: 'sup-slot',
text: '8折'
text: '8 折'
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default {
},
desc: {
'zh-CN':
'<p>通过 <code>disabled</code> 设置按钮组是否禁用,数据项设置 <code>disabled</code> 属性可以禁用单个按钮,数据项设置 <code>tip</code> 属性(v3.17.0版本增加此功能)增加按钮悬浮提示功能。</p>',
'<p>通过 <code>disabled</code> 设置按钮组是否禁用,数据项设置 <code>disabled</code> 属性可以禁用单个按钮,数据项设置 <code>tip</code> 属性 (v3.17.0 版本增加此功能) 增加按钮悬浮提示功能。</p>',
'en-US':
'<p>You can set whether to disable the button group through <code>disabled</code>. You can set the <code>disabled</code> attribute to disable a single button. You can set the <code>tip</code> attribute to add the reason for disabling the button. </p></p>'
},
Expand Down
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/button/reset-time.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test('测试按钮禁用事件', async ({ page }) => {
const noDisabled = demo.getByRole('button', { name: '无禁用' })
const fiveSecondDisabled = demo.getByRole('button', { name: '禁用 5 秒' })

// 默认禁用1S
// 默认禁用 1S
await defalutDisabled.click()
await expect(defalutDisabled).toBeDisabled()
await page.waitForTimeout(1000)
Expand All @@ -20,7 +20,7 @@ test('测试按钮禁用事件', async ({ page }) => {
await noDisabled.click()
await expect(noDisabled).not.toBeDisabled()

// 自定义禁用5s
// 自定义禁用 5s
await fiveSecondDisabled.click()
await expect(fiveSecondDisabled).toBeDisabled()
await page.waitForTimeout(5000)
Expand Down

0 comments on commit c15edf5

Please sign in to comment.