[build] 4.1.14
This commit is contained in:
parent
4bde6d685c
commit
f598e53098
6 changed files with 21 additions and 15 deletions
|
|
@ -3318,7 +3318,7 @@ History.prototype.getBasePath = function getBasePath () {
|
|||
return this.config.basePath
|
||||
};
|
||||
|
||||
History.prototype.getFile = function getFile (path) {
|
||||
History.prototype.getFile = function getFile (path, isRelative) {
|
||||
path = path || this.getCurrentPath();
|
||||
|
||||
var ref = this;
|
||||
|
|
@ -3330,6 +3330,10 @@ History.prototype.getFile = function getFile (path) {
|
|||
path = path === '/README.md' ? (config.homepage || path) : path;
|
||||
path = isAbsolutePath(path) ? path : getPath(base, path);
|
||||
|
||||
if (isRelative) {
|
||||
path = path.replace(new RegExp(("^" + base)), '');
|
||||
}
|
||||
|
||||
return path
|
||||
};
|
||||
|
||||
|
|
@ -3423,7 +3427,7 @@ var HashHistory = (function (History$$1) {
|
|||
|
||||
return {
|
||||
path: path,
|
||||
file: this.getFile(path),
|
||||
file: this.getFile(path, true),
|
||||
query: parseQuery(query)
|
||||
}
|
||||
};
|
||||
|
|
@ -3536,6 +3540,12 @@ function routerMixin (proto) {
|
|||
|
||||
var lastRoute = {};
|
||||
|
||||
function updateRender (vm) {
|
||||
vm.router.normalize();
|
||||
vm.route = vm.router.parse();
|
||||
body.setAttribute('data-page', vm.route.file);
|
||||
}
|
||||
|
||||
function initRouter (vm) {
|
||||
var config = vm.config;
|
||||
var mode = config.routerMode || 'hash';
|
||||
|
|
@ -3548,13 +3558,11 @@ function initRouter (vm) {
|
|||
}
|
||||
|
||||
vm.router = router;
|
||||
|
||||
router.normalize();
|
||||
lastRoute = vm.route = router.parse();
|
||||
updateRender(vm);
|
||||
lastRoute = vm.route;
|
||||
|
||||
router.onchange(function (_) {
|
||||
router.normalize();
|
||||
vm.route = router.parse();
|
||||
updateRender(vm);
|
||||
vm._updateRender();
|
||||
|
||||
if (lastRoute.path === vm.route.path) {
|
||||
|
|
@ -3750,7 +3758,7 @@ initGlobalAPI();
|
|||
/**
|
||||
* Version
|
||||
*/
|
||||
Docsify.version = '4.1.13';
|
||||
Docsify.version = '4.1.14';
|
||||
|
||||
/**
|
||||
* Run Docsify
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue