fix: 修复 layui.router 返回 href 属性

This commit is contained in:
xuexb
2018-01-08 04:01:08 +08:00
parent 974bc86d9c
commit cbba1d984a
2 changed files with 15 additions and 2 deletions

View File

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