-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
269 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<html> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<!-- import CSS --> | ||
<link rel="stylesheet" href="https://unpkg.com/@qvant/qui/dist/qui.css" /> | ||
</head> | ||
|
||
<body> | ||
<div id="app"> | ||
<div class="block"> | ||
<q-breadcrumbs :route="route" /> | ||
</div> | ||
</div> | ||
</body> | ||
<!-- import Vue before Qui --> | ||
<script src="https://unpkg.com/vue@next"></script> | ||
<!-- import JavaScript --> | ||
<script src="https://unpkg.com/@qvant/qui-max@latest"></script> | ||
<script> | ||
const app = Vue.createApp({ | ||
setup() { | ||
const route = Vue.computed(() => { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
return [ | ||
{ | ||
path: 'path-a', | ||
name: 'ROUTE_A', | ||
meta: { | ||
breadcrumb: 'First route' | ||
} | ||
}, | ||
{ | ||
path: 'path-b', | ||
name: 'ROUTE_b', | ||
meta: { | ||
breadcrumb: 'Second route' | ||
} | ||
}, | ||
{ | ||
path: 'path-c', | ||
name: 'ROUTE_c', | ||
meta: { | ||
breadcrumb: 'Third route' | ||
} | ||
}, | ||
]; | ||
}); | ||
|
||
return { route } | ||
} | ||
}); | ||
|
||
const Qui = window['qui-max'].default; | ||
app.use(Qui); | ||
app.mount('#app'); | ||
</script> | ||
<style> | ||
.block { | ||
margin: 20px; | ||
width: 450px; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
</style> | ||
|
||
</html> | ||
This comment has been minimized.
Sorry, something went wrong. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<html> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<!-- import CSS --> | ||
<link rel="stylesheet" href="https://unpkg.com/@qvant/qui/dist/qui.css" /> | ||
</head> | ||
|
||
<body> | ||
<div id="app"> | ||
<div class="block"> | ||
<q-breadcrumbs :route="route" last="Custom String" /> | ||
</div> | ||
</div> | ||
</body> | ||
<!-- import Vue before Qui --> | ||
<script src="https://unpkg.com/vue@next"></script> | ||
<!-- import JavaScript --> | ||
<script src="https://unpkg.com/@qvant/qui-max@latest"></script> | ||
<script> | ||
const app = Vue.createApp({ | ||
setup() { | ||
const route = Vue.computed(() => { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
return [ | ||
{ | ||
path: 'path-a', | ||
name: 'ROUTE_A', | ||
meta: { | ||
breadcrumb: 'First route' | ||
} | ||
}, | ||
{ | ||
path: 'path-b', | ||
name: 'ROUTE_b', | ||
meta: { | ||
breadcrumb: 'Second route' | ||
} | ||
}, | ||
{ | ||
path: 'path-c', | ||
name: 'ROUTE_c', | ||
meta: { | ||
breadcrumb: 'Third route' | ||
} | ||
}, | ||
]; | ||
}); | ||
|
||
return { route } | ||
} | ||
}); | ||
|
||
const Qui = window['qui-max'].default; | ||
app.use(Qui); | ||
app.mount('#app'); | ||
</script> | ||
<style> | ||
.block { | ||
margin: 20px; | ||
width: 450px; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
</style> | ||
|
||
</html> | ||
This comment has been minimized.
Sorry, something went wrong. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
# QBreadcrumbs | ||
|
||
Displays the location of the current page, shows all nested levels. Try a sandbox [story](https://qui-max.netlify.app/?path=/story/components-qbreadcrumbs--default) | ||
|
||
## Example | ||
|
||
Default view: | ||
|
||
<iframe height="80" style="width: 100%;" scrolling="no" frameborder="no" src="/qui-max/QBreadcrumbs.html"></iframe> | ||
|
||
Using in template: | ||
|
||
```vue | ||
<q-breadcrumbs :route="route" /> | ||
``` | ||
Using in component instance: | ||
<CodeGroup> | ||
<CodeGroupItem title="JS" active> | ||
|
||
```js | ||
setup() { | ||
const route = [ | ||
{ | ||
path: 'path-a', | ||
name: 'ROUTE_A', | ||
meta: { | ||
breadcrumb: 'First route' | ||
} | ||
}, | ||
{ | ||
path: 'path-b', | ||
name: 'ROUTE_b', | ||
meta: { | ||
breadcrumb: 'Second route' | ||
} | ||
}, | ||
{ | ||
path: 'path-c', | ||
name: 'ROUTE_c', | ||
meta: { | ||
breadcrumb: 'Third route' | ||
} | ||
}, | ||
]; | ||
|
||
return { route } | ||
} | ||
``` | ||
</CodeGroupItem> | ||
|
||
<CodeGroupItem title="TS"> | ||
|
||
```ts | ||
import type { QBreadcrumbsPropRoute } from '@qvant/qui-max'; | ||
|
||
setup() { | ||
const route: QBreadcrumbsPropRoute = [ | ||
{ | ||
path: 'path-a', | ||
name: 'ROUTE_A', | ||
meta: { | ||
breadcrumb: 'First route' | ||
} | ||
}, | ||
{ | ||
path: 'path-b', | ||
name: 'ROUTE_b', | ||
meta: { | ||
breadcrumb: 'Second route' | ||
} | ||
}, | ||
{ | ||
path: 'path-c', | ||
name: 'ROUTE_c', | ||
meta: { | ||
breadcrumb: 'Third route' | ||
} | ||
}, | ||
]; | ||
|
||
return { route }; | ||
} | ||
``` | ||
|
||
</CodeGroupItem> | ||
</CodeGroup> | ||
|
||
## Props | ||
|
||
### route | ||
|
||
- Type: `Array` | ||
- Default: `null` | ||
|
||
```ts | ||
import type { QBreadcrumbsPropRoute } from '@qvant/qui-max'; | ||
``` | ||
|
||
`route` MUST be an `Array` of `Object`s, each object MUST contain required fields: | ||
- `path` - uses as route path | ||
- `name` - route name | ||
- `meta` - MUST contain: | ||
- `breadcrumb` - visible title | ||
|
||
### linkComponent | ||
|
||
- Type: `String` | ||
- Default: `'RouterLink'` | ||
|
||
The name of the component for enabling user navigation in a router-enabled app, if you use [Vue Router](https://router.vuejs.org/), you don't need change this prop, `RouterLink` by default. With Nuxt change on `NuxtLink` | ||
|
||
### last | ||
|
||
- Type: `String` | ||
|
||
Changes last crumb with custom string | ||
|
||
```vue | ||
<q-breadcrumbs :route="route" last="Custom string" /> | ||
``` | ||
|
||
<iframe height="80" style="width: 100%;" scrolling="no" frameborder="no" src="/qui-max/QBreadcrumbs[last].html"></iframe> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
пофикшу