Skip to content

Commit dbec29b

Browse files
committed
[build] 0.7.5
1 parent e3db00b commit dbec29b

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

dist/vue-router.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-router v0.7.4
2+
* vue-router v0.7.5
33
* (c) 2015 Evan You
44
* Released under the MIT License.
55
*/
@@ -344,7 +344,9 @@ return /******/ (function(modules) { // webpackBootstrap
344344
throw new Error('Must start vue-router with a component and a ' + 'root container.');
345345
}
346346
this._appContainer = container;
347-
this._appConstructor = typeof App === 'function' ? App : Vue.extend(App);
347+
var Ctor = this._appConstructor = typeof App === 'function' ? App : Vue.extend(App);
348+
// give it a name for better debugging
349+
Ctor.options.name = Ctor.options.name || 'RouterApp';
348350
}
349351
this.history.start();
350352
};
@@ -2683,22 +2685,28 @@ return /******/ (function(modules) { // webpackBootstrap
26832685
if (e.button !== 0) return;
26842686

26852687
var target = _this.target;
2686-
if (_this.el.tagName === 'A' || e.target === _this.el) {
2687-
// v-link on <a v-link="'path'">
2688+
var go = function go(target) {
26882689
e.preventDefault();
26892690
if (target != null) {
26902691
router.go(target);
26912692
}
2693+
};
2694+
2695+
if (_this.el.tagName === 'A' || e.target === _this.el) {
2696+
// v-link on <a v-link="'path'">
2697+
go(target);
26922698
} else {
26932699
// v-link delegate on <div v-link>
26942700
var el = e.target;
26952701
while (el && el.tagName !== 'A' && el !== _this.el) {
26962702
el = el.parentNode;
26972703
}
2698-
if (!el || el.tagName !== 'A' || !el.href) return;
2699-
if (sameOrigin(el)) {
2700-
e.preventDefault();
2701-
router.go({
2704+
if (!el) return;
2705+
if (el.tagName !== 'A' || !el.href) {
2706+
// allow not anchor
2707+
go(target);
2708+
} else if (sameOrigin(el)) {
2709+
go({
27022710
path: el.pathname,
27032711
replace: target && target.replace,
27042712
append: target && target.append

0 commit comments

Comments
 (0)