Skip to content

Commit

Permalink
fix(breadcrumb): [breadcrumb]modify demo of disable page redirection (#…
Browse files Browse the repository at this point in the history
…2272)

* fix: modify demo

* fix: modify e2e-test
  • Loading branch information
James-9696 authored Oct 16, 2024
1 parent a8fccf6 commit 34c10f3
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<template>
<tiny-breadcrumb @select="breadcrumbClick">
<tiny-breadcrumb-item :to="{ path: '/' }" @select="breadcrumbItemClick" label="首页"></tiny-breadcrumb-item>
<!-- path 可填写跳转的路由 -->
<tiny-breadcrumb-item :to="{ path: '' }" @select="breadcrumbItemClick" label="首页"></tiny-breadcrumb-item>
<tiny-breadcrumb-item>
<a href="/"> 产品 </a>
<a href="#"> 产品 </a>
</tiny-breadcrumb-item>
<tiny-breadcrumb-item :to="{ path: '/breadcrumb' }"> 软件 </tiny-breadcrumb-item>
<tiny-breadcrumb-item :to="{ path: '#' }"> 软件 </tiny-breadcrumb-item>
</tiny-breadcrumb>
</template>

Expand Down
7 changes: 4 additions & 3 deletions examples/sites/demos/pc/app/breadcrumb/base.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<template>
<tiny-breadcrumb @select="breadcrumbClick">
<tiny-breadcrumb-item :to="{ path: '/' }" @select="breadcrumbItemClick" label="首页"></tiny-breadcrumb-item>
<!-- path 可填写跳转的路由 -->
<tiny-breadcrumb-item :to="{ path: '' }" @select="breadcrumbItemClick" label="首页"></tiny-breadcrumb-item>
<tiny-breadcrumb-item>
<a href="/"> 产品 </a>
<a href="#"> 产品 </a>
</tiny-breadcrumb-item>
<tiny-breadcrumb-item :to="{ path: '/breadcrumb' }"> 软件 </tiny-breadcrumb-item>
<tiny-breadcrumb-item :to="{ path: '#' }"> 软件 </tiny-breadcrumb-item>
</tiny-breadcrumb>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import { Breadcrumb as TinyBreadcrumb, Notify } from '@opentiny/vue'
const options = ref([
{
label: '首页',
to: { path: '/' }
to: { path: '#' }
},
{
label: '产品',
to: { path: '/breadcrumb' }
to: { path: '#' }
},
{
label: '软件',
Expand All @@ -26,11 +26,11 @@ const options = ref([
const options1 = ref([
{
name: '首页',
to: { path: '/' }
to: { path: '' }
},
{
name: '产品',
to: { path: '/breadcrumb' }
to: { path: '#' }
},
{
name: '软件',
Expand Down
8 changes: 4 additions & 4 deletions examples/sites/demos/pc/app/breadcrumb/options.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ export default {
options: [
{
label: '首页',
to: { path: '/' }
to: { path: '#' }
},
{
label: '产品',
to: { path: '/breadcrumb' }
to: { path: '#' }
},
{
label: '软件',
Expand All @@ -31,11 +31,11 @@ export default {
options1: [
{
name: '首页',
to: { path: '/' }
to: { path: '' }
},
{
name: '产品',
to: { path: '/breadcrumb' }
to: { path: '#' }
},
{
name: '软件',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<template>
<div>
<tiny-breadcrumb separator="/">
<tiny-breadcrumb-item><a href="/">首页</a></tiny-breadcrumb-item>
<tiny-breadcrumb-item><a href="#">首页</a></tiny-breadcrumb-item>
<tiny-breadcrumb-item>
<a href="/"> 产品 </a>
<a href="#"> 产品 </a>
</tiny-breadcrumb-item>
<tiny-breadcrumb-item><a href="/"> 软件</a></tiny-breadcrumb-item>
<tiny-breadcrumb-item><a href="#"> 软件</a></tiny-breadcrumb-item>
</tiny-breadcrumb>
<br />
<tiny-breadcrumb :separator-icon="IconBoat">
<tiny-breadcrumb-item><a hrfe="/">首页</a></tiny-breadcrumb-item>
<tiny-breadcrumb-item><a hrfe="#">首页</a></tiny-breadcrumb-item>
<tiny-breadcrumb-item>
<a href="/"> 产品 </a>
<a href="#"> 产品 </a>
</tiny-breadcrumb-item>
<tiny-breadcrumb-item><a href="/"> 软件</a></tiny-breadcrumb-item>
<tiny-breadcrumb-item><a href="#"> 软件</a></tiny-breadcrumb-item>
</tiny-breadcrumb>
</div>
</template>
Expand Down
12 changes: 6 additions & 6 deletions examples/sites/demos/pc/app/breadcrumb/separator.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<template>
<div>
<tiny-breadcrumb separator="/">
<tiny-breadcrumb-item><a href="/">首页</a></tiny-breadcrumb-item>
<tiny-breadcrumb-item><a href="#">首页</a></tiny-breadcrumb-item>
<tiny-breadcrumb-item>
<a href="/"> 产品 </a>
<a href="#"> 产品 </a>
</tiny-breadcrumb-item>
<tiny-breadcrumb-item><a href="/"> 软件</a></tiny-breadcrumb-item>
<tiny-breadcrumb-item><a href="#"> 软件</a></tiny-breadcrumb-item>
</tiny-breadcrumb>
<br />
<tiny-breadcrumb :separator-icon="IconBoat">
<tiny-breadcrumb-item><a hrfe="/">首页</a></tiny-breadcrumb-item>
<tiny-breadcrumb-item><a hrfe="#">首页</a></tiny-breadcrumb-item>
<tiny-breadcrumb-item>
<a href="/"> 产品 </a>
<a href="#"> 产品 </a>
</tiny-breadcrumb-item>
<tiny-breadcrumb-item><a href="/"> 软件</a></tiny-breadcrumb-item>
<tiny-breadcrumb-item><a href="#"> 软件</a></tiny-breadcrumb-item>
</tiny-breadcrumb>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<tiny-breadcrumb size="medium" @select="breadcrumbClick">
<tiny-breadcrumb-item :to="{ path: '/' }" @select="breadcrumbItemClick" label="首页"></tiny-breadcrumb-item>
<tiny-breadcrumb size="medium">
<tiny-breadcrumb-item :to="{ path: '' }" @select="breadcrumbItemClick" label="首页"></tiny-breadcrumb-item>
<tiny-breadcrumb-item>
<a href="/"> 产品 </a>
<a href="#"> 产品 </a>
</tiny-breadcrumb-item>
<tiny-breadcrumb-item :to="{ path: '/breadcrumb' }"> 软件 </tiny-breadcrumb-item>
<tiny-breadcrumb-item :to="{ path: '#' }"> 软件 </tiny-breadcrumb-item>
</tiny-breadcrumb>
</template>

Expand Down
8 changes: 4 additions & 4 deletions examples/sites/demos/pc/app/breadcrumb/size.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<tiny-breadcrumb size="medium" @select="breadcrumbClick">
<tiny-breadcrumb-item :to="{ path: '/' }" @select="breadcrumbItemClick" label="首页"></tiny-breadcrumb-item>
<tiny-breadcrumb size="medium">
<tiny-breadcrumb-item :to="{ path: '' }" @select="breadcrumbItemClick" label="首页"></tiny-breadcrumb-item>
<tiny-breadcrumb-item>
<a href="/"> 产品 </a>
<a href="#"> 产品 </a>
</tiny-breadcrumb-item>
<tiny-breadcrumb-item :to="{ path: '/breadcrumb' }"> 软件 </tiny-breadcrumb-item>
<tiny-breadcrumb-item :to="{ path: '#' }"> 软件 </tiny-breadcrumb-item>
</tiny-breadcrumb>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<tiny-breadcrumb>
<tiny-breadcrumb-item>首页</tiny-breadcrumb-item>
<tiny-breadcrumb-item>
<a href="/"> 产品 </a>
<a href="#"> 产品 </a>
</tiny-breadcrumb-item>
<tiny-breadcrumb-item :to="{ path: '/' }" replace><span>软件</span></tiny-breadcrumb-item>
<tiny-breadcrumb-item :to="{ path: '#' }" replace><span>软件</span></tiny-breadcrumb-item>
</tiny-breadcrumb>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ test('Breadcrumb 自定义节点', async ({ page }) => {

const breadcrumbItem = page.locator('.tiny-breadcrumb__item')
const slotItem = breadcrumbItem.nth(1).locator('a')
await expect(slotItem).toHaveAttribute('href', '/')
await expect(slotItem).toHaveAttribute('href', '#')
})
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/breadcrumb/slot-default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<tiny-breadcrumb>
<tiny-breadcrumb-item>首页</tiny-breadcrumb-item>
<tiny-breadcrumb-item>
<a href="/"> 产品 </a>
<a href="#"> 产品 </a>
</tiny-breadcrumb-item>
<tiny-breadcrumb-item :to="{ path: '/' }" replace><span>软件</span></tiny-breadcrumb-item>
<tiny-breadcrumb-item :to="{ path: '#' }" replace><span>软件</span></tiny-breadcrumb-item>
</tiny-breadcrumb>
</div>
</template>
Expand Down

0 comments on commit 34c10f3

Please sign in to comment.