-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
26 changed files
with
10,312 additions
and
374 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,187 +1 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>vue breadcrumbs</title> | ||
<link rel="stylesheet" href="https://unpkg.com/bootstrap@4.2.1/dist/css/bootstrap.min.css"> | ||
<script src="https://unpkg.com/jquery@3.3.1/dist/jquery.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script> | ||
<script src="https://unpkg.com/bootstrap@4.2.1/dist/js/bootstrap.min.js"></script> | ||
<script src="https://unpkg.com/vue@2.6.10/dist/vue.min.js"></script> | ||
<script src="https://unpkg.com/vue-router@3.0.6/dist/vue-router.min.js"></script> | ||
<script src="vue-2-breadcrumbs.min.js"></script> | ||
</head> | ||
<body> | ||
<div id="app"> | ||
<ul class="nav"> | ||
<li class="nav-item dropdown"> | ||
<router-link to="/feeds" class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Feeds</router-link> | ||
<div class="dropdown-menu" aria-labelledby="navbarDropdown"> | ||
<router-link to="/feeds/foo" class="dropdown-item">Foo</router-link> | ||
<router-link to="/feeds/bar" class="dropdown-item">Bar</router-link> | ||
<router-link to="/feeds/baz" class="dropdown-item">Baz</router-link> | ||
<router-link to="/feeds/1" class="dropdown-item">Other Feed 1</router-link> | ||
<router-link to="/feeds/2" class="dropdown-item">Other Feed 2</router-link> | ||
<router-link to="/feeds/3" class="dropdown-item">Other Feed 3</router-link> | ||
</div> | ||
</li> | ||
<li class="nav-item dropdown"> | ||
<router-link to="/" class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Home</router-link> | ||
<div class="dropdown-menu" aria-labelledby="navbarDropdown"> | ||
<router-link :to="{ name: 'settings'}" class="dropdown-item">Settings</router-link> | ||
</div> | ||
</li> | ||
</ul> | ||
<breadcrumbs></breadcrumbs> | ||
<router-view ></router-view> | ||
|
||
</div> | ||
<script> | ||
const Feeds = { template: '<div><router-view/></div>' }; | ||
const Feed = { template: '<div><h2>Feed</h2></div>' }; | ||
const Biz = { template: '<div><h2>Feeds</h2></div>' }; | ||
|
||
const Bar = { template: '<div><h2>Bar</h2></div>' }; | ||
const Baz = { template: '<div><h2>Baz</h2></div>' }; | ||
const Home = { | ||
template: ` | ||
<router-view name="sidebar"></router-view> | ||
<router-view name="content"></router-view> | ||
` | ||
} | ||
const Foo = { | ||
template: '<div>Foo</div>' | ||
} | ||
const Menu = { | ||
template: ` | ||
<div> | ||
<router-link :to="{name:'entities', params: {entityName:'entity1'}}">entities 1</router-link> </br> | ||
<router-link :to="{name:'entities', params: {entityName:'entity2'}}">entities 2</router-link> </br> | ||
<router-link :to="{name:'entities', params: {entityName:'entity3'}}">entities 3</router-link> | ||
</div> | ||
` | ||
} | ||
const View = { | ||
template: ` | ||
<div> | ||
<pre>{{ $route.params }}</pre> | ||
</div> | ||
` | ||
} | ||
|
||
const routes = [ | ||
{ | ||
path: '/', | ||
component: Home, | ||
meta: { | ||
breadcrumb: 'home' | ||
}, | ||
children: [{ | ||
path: 'settings', | ||
name: 'settings', | ||
components: { | ||
content: { template: `<router-view/>` }, | ||
sidebar: Menu | ||
}, | ||
meta: { | ||
breadcrumb: 'Settings' | ||
}, | ||
children: [{ | ||
path: 'entities/:entityName', | ||
name: 'entities', | ||
component: { template: `<router-view/>` }, | ||
redirect: { | ||
name: 'entityView' | ||
}, | ||
meta: { | ||
breadcrumb: routeParams => `${routeParams.entityName}` | ||
}, | ||
children: [{ | ||
path: 'view', | ||
name: 'entityView', | ||
component: View, | ||
props: true, | ||
meta: { | ||
breadcrumb: 'View' | ||
}, | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
|
||
{ | ||
path: '/feeds', | ||
component: Feeds, | ||
meta: { | ||
breadcrumb: 'Feeds' | ||
}, | ||
children: [ | ||
{ | ||
path: '', | ||
component: Biz | ||
}, | ||
{ | ||
path: 'foo', | ||
component: Foo, | ||
meta: { | ||
breadcrumb: () => `foo ${1 + 1}` | ||
} | ||
}, | ||
{ | ||
path: 'bar', | ||
component: Bar, | ||
meta: { | ||
breadcrumb: 'bar' | ||
} | ||
}, | ||
{ | ||
name: 'baz', | ||
path: 'baz', | ||
component: Baz, | ||
meta: { | ||
breadcrumb() { | ||
const { name } = this.$route; | ||
return `name "${name}" of context route`; | ||
} | ||
} | ||
}, | ||
{ | ||
path: ':id', | ||
component: Feed, | ||
meta: { | ||
breadcrumb: params => `Other Feed ${params.id}` | ||
}, | ||
redirect: { | ||
name: 'view' | ||
}, | ||
children: [ | ||
{ | ||
path: 'view', | ||
name: 'view', | ||
component: View, | ||
meta: { | ||
breadcrumb: 'View' | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
|
||
Vue.use(VueBreadcrumbs.VueBreadcrumbsPlugin); | ||
|
||
const router = new VueRouter({ | ||
routes | ||
}) | ||
|
||
new Vue({ | ||
router, | ||
el: '#app' | ||
}) | ||
</script> | ||
</body> | ||
</html> | ||
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><title>Vue App</title><link href=/css/chunk-3302e43a.13378d60.css rel=prefetch><link href=/js/chunk-3302e43a.ccffe96f.js rel=prefetch><link href=/css/app.4778c4d5.css rel=preload as=style><link href=/js/app.e926389f.js rel=preload as=script><link href=/js/chunk-vendors.b275fd63.js rel=preload as=script><link href=/css/app.4778c4d5.css rel=stylesheet></head><body><div id=app></div><script src=/js/chunk-vendors.b275fd63.js></script><script src=/js/app.e926389f.js></script></body></html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.