Skip to content

fix(breadcrumb): [breadcrumb]modify demo of disable page redirection #2272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix typo in href attribute.

While the change from href="/" to href="#" is consistent with previous modifications, there's a typo in the attribute name. It's currently hrfe instead of href.

Please apply the following fix:

-      <tiny-breadcrumb-item><a hrfe="#">首页</a></tiny-breadcrumb-item>
+      <tiny-breadcrumb-item><a href="#">首页</a></tiny-breadcrumb-item>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<tiny-breadcrumb-item><a hrfe="#">首页</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>
</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>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix typo in href attribute.

There's a typographical error in the attribute name. It should be "href" instead of "hrfe".

Please apply the following change:

-      <tiny-breadcrumb-item><a hrfe="#">首页</a></tiny-breadcrumb-item>
+      <tiny-breadcrumb-item><a href="#">首页</a></tiny-breadcrumb-item>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<tiny-breadcrumb-item><a hrfe="#">首页</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>
</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
Loading