Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
ccqgithub committed Jun 25, 2019
1 parent 30e066c commit a00c24d
Show file tree
Hide file tree
Showing 11 changed files with 681 additions and 681 deletions.
648 changes: 324 additions & 324 deletions dist/router.common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/router.common.js.map

Large diffs are not rendered by default.

646 changes: 323 additions & 323 deletions dist/router.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/router.esm.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions examples/auth-flow/components/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 22,7 @@
</li>
</ul>

<match-first>
<route-switch>
<route path="/dashboard" v-slot:default="{ match, location, history }">
<check-login :logged-in="loggedIn">
<dashboard :match="match" :location="location" :history="history" />
Expand All @@ -45,12 45,12 @@
<route>
<p>You are logged {{ loggedIn ? 'in' : 'out' }}</p>
</route>
</match-first>
</route-switch>
</div>
</template>

<script>
import { Route, RouterLink, MatchFirst, Redirect } from 'vue-router-lite'
import { Route, RouterLink, RouteSwitch, Redirect } from 'vue-router-lite'
import auth from '../auth'
import About from './About.vue'
import Dashboard from './Dashboard.vue'
Expand All @@ -64,7 64,7 @@ export default {
About,
Dashboard,
Login,
MatchFirst,
RouteSwitch,
CheckLogin,
Redirect
},
Expand Down
8 changes: 4 additions & 4 deletions examples/keep-alive/app.js
Original file line number Diff line number Diff line change
@@ -1,5 1,5 @@
import Vue from 'vue'
import { BrowserRouter as Router, Route, RouterLink, MatchFirst } from 'vue-router-lite'
import { BrowserRouter as Router, Route, RouterLink, RouteSwitch } from 'vue-router-lite'

const Home = {
template: `
Expand Down Expand Up @@ -110,7 110,7 @@ const App = {
components: {
Route,
RouterLink,
MatchFirst,
RouteSwitch,
Home,
Alive,
NestAlive
Expand All @@ -136,7 136,7 @@ const App = {
<hr />
<keep-alive>
<match-first>
<route-switch>
<route exact path="/" v-slot="props">
<home v-bind="props"/>
</route>
Expand All @@ -148,7 148,7 @@ const App = {
<route path="/nest-alive" v-slot="props">
<nest-alive v-bind="props" />
</route>
</match-first>
</route-switch>
</keep-alive>
</div>
`,
Expand Down
10 changes: 5 additions & 5 deletions examples/no-match/app.js
Original file line number Diff line number Diff line change
@@ -1,10 1,10 @@
import Vue from 'vue'
import { BrowserRouter as Router, Route, RouterLink, Redirect, MatchFirst } from 'vue-router-lite'
import { BrowserRouter as Router, Route, RouterLink, Redirect, RouteSwitch } from 'vue-router-lite'

const Home = {
template: `
<p>
A <code>&lt;match-first></code> renders the first child <code>&lt;route></code>{{" "}}
A <code>&lt;route-switch></code> renders the first child <code>&lt;route></code>{{" "}}
that matches. A <code>&lt;route></code> with no <code>path</code> always
matches.
</p>
Expand Down Expand Up @@ -38,7 38,7 @@ const App = {
Route,
RouterLink,
Redirect,
MatchFirst,
RouteSwitch,
Home,
WillMatch,
NoMatch,
Expand All @@ -64,7 64,7 @@ const App = {
<router-link to="/also/will/not/match">Also Will Not Match</router-link>
</li>
</ul>
<match-first>
<route-switch>
<route path="/" exact>
<home />
</route>
Expand All @@ -77,7 77,7 @@ const App = {
<route v-slot:default="{ location }">
<no-match :location="location" />
</route>
</match-first>
</route-switch>
</div>
</div>
`,
Expand Down
14 changes: 7 additions & 7 deletions examples/transitions/app.js
Original file line number Diff line number Diff line change
@@ -1,5 1,5 @@
import Vue from 'vue'
import { BrowserRouter as Router, Route, RouterLink, MatchFirst } from 'vue-router-lite'
import { BrowserRouter as Router, Route, RouterLink, RouteSwitch } from 'vue-router-lite'

const Home = {
template: `
Expand All @@ -23,7 23,7 @@ const Parent = {
components: {
RouterLink,
Route,
MatchFirst,
RouteSwitch,
Default,
Foo,
Bar
Expand Down Expand Up @@ -51,7 51,7 @@ const Parent = {
<div class="parent">
<h2>Parent</h2>
<transition :name="transitionName">
<match-first>
<route-switch>
<route :path="match.url" exact key="default" v-slot="props">
<default class="child-view" v-bind="props"/>
</route>
Expand All @@ -61,7 61,7 @@ const Parent = {
<route :path="match.url '/bar'" key="bar" v-slot="props">
<bar class="child-view" v-bind="props"/>
</route>
</match-first>
</route-switch>
</transition>
</div>
`
Expand All @@ -71,7 71,7 @@ const App = {
components: {
RouterLink,
Route,
MatchFirst,
RouteSwitch,
Home,
Parent
},
Expand All @@ -91,14 91,14 @@ const App = {
</div>
<transition name="fade" mode="out-in">
<match-first>
<route-switch>
<route path="/" key="home" exact v-slot="props">
<home class="page" v-bind="props"/>
</route>
<route path="/parent" key="parent" v-slot="props">
<parent class="page" v-bind="props"/>
</route>
</match-first>
</route-switch>
</transition>
</div>
`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
<script>
export default {
name: 'router-ref',
name: 'router-context',
inject: ['router', 'route'],
data() {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 3,7 @@ import { assert, isNotTextNode } from '../util/utils';
import matchPath from "../util/matchPath";
export default {
name: 'match-first',
name: 'route-switch',
functional: true,
props: {
location: Object
Expand All @@ -14,7 14,7 @@ export default {
assert(
router,
`You should not use <match-first> outside a <router>'`
`You should not use <route-switch> outside a <router>'`
);
let vnodeKey = '';
Expand Down
18 changes: 9 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,14 1,14 @@
import Router from './component/Router.vue';
import MemoryRouter from './component/MemoryRouter.vue';
import HashRouter from './component/HashRouter.vue';
import BrowserRouter from './component/BrowserRouter.vue';
import StaticRouter from './component/StaticRouter.vue';
import Route from './component/Route.vue';
import Router from './component/Router.vue';
import RouterLink from './component/RouterLink.vue';
import Prompt from './component/Prompt.vue';
import Redirect from './component/Redirect.vue';
import RouterLink from './component/RouterLink.vue';
import RouterRef from './component/RouterRef.vue';
import MatchFirst from './component/MatchFirst.vue';
import Route from './component/Route.vue';
import RouteContext from './component/RouteContext.vue';
import RouteSwitch from './component/RouteSwitch.vue';

import generatePath from './util/generatePath';
import matchPath from './util/matchPath';
Expand All @@ -18,17 18,17 @@ import createMemoryHistory from './util/createMemoryHistory';
import createStaticHistory from './util/createStaticHistory';

export {
Router,
MemoryRouter,
HashRouter,
BrowserRouter,
StaticRouter,
Router,
RouterLink,
Prompt,
Redirect,
Route,
RouterLink,
RouterRef,
MatchFirst,
RouteContext,
RouteSwitch,

generatePath,
matchPath,
Expand Down

0 comments on commit a00c24d

Please sign in to comment.