Merge pull request #196 from xuexb/fix/router

fix: 修复 router href 中报错
This commit is contained in:
前端小武 2018-04-03 10:47:05 +08:00 committed by GitHub
commit b7f9a53cd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,7 @@ describe('layui', function () {
it('router querystring', function () { it('router querystring', function () {
expect(layui.router('#/a=1/b=2/c=')).to.deep.equal($.extend({}, defaultData, { expect(layui.router('#/a=1/b=2/c=')).to.deep.equal($.extend({}, defaultData, {
href: 'a=1/b=2/c=', href: '/a=1/b=2/c=',
search: { search: {
a: '1', a: '1',
b: '2', b: '2',
@ -77,7 +77,7 @@ describe('layui', function () {
expect(layui.router('#/name#layui')).to.deep.equal($.extend({}, defaultData, { expect(layui.router('#/name#layui')).to.deep.equal($.extend({}, defaultData, {
hash: '#layui', hash: '#layui',
path: ['name'], path: ['name'],
href: 'name#layui' href: '/name#layui'
})); }));
expect(layui.router('#/name#layui').hash).to.equal('#layui'); expect(layui.router('#/name#layui').hash).to.equal('#layui');
expect(layui.router('#/name#layui=1').hash).to.equal('#layui=1'); expect(layui.router('#/name#layui=1').hash).to.equal('#layui=1');
@ -93,7 +93,7 @@ describe('layui', function () {
c: '2' c: '2'
}, },
hash: '#hash', hash: '#hash',
href: 'a/b/c=2#hash' href: '/a/b/c=2#hash'
}); });
}); });
}); });