Skip to content

Commit

Permalink
增加页面缓存事例;页面缓存数量不能为1
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoda committed Sep 19, 2016
1 parent b08c787 commit 5f3ca3e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions dist/spa-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -1833,6 +1833,7 @@
*/

$doc.on('spa:viewcachecount', function(event, options) {
options.count = options.count === 1 ? 2 : options.count
viewcachecount = options.count
})

Expand Down
2 changes: 1 addition & 1 deletion dist/spa-apis.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/spa.js
Original file line number Diff line number Diff line change
Expand Up @@ -1833,6 +1833,7 @@
*/

$doc.on('spa:viewcachecount', function(event, options) {
options.count = options.count === 1 ? 2 : options.count
viewcachecount = options.count
})

Expand Down
2 changes: 1 addition & 1 deletion dist/spa.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion docs/boot.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
requirejs.config({
baseUrl: '',
// urlArgs: "v=" + (new Date()).getTime(),
urlArgs: 'v=20140320',
urlArgs: 'v=20160919',
paths: {}
})


var $doc = $(document)

// 设置缓存页面数量
$doc.trigger('spa:viewcachecount', {count: 2})

// 首页
var pageHome = {
route: '',
Expand Down
1 change: 1 addition & 0 deletions src/spa.js
Original file line number Diff line number Diff line change
Expand Up @@ -1826,6 +1826,7 @@
*/

$doc.on('spa:viewcachecount', function(event, options) {
options.count = options.count === 1 ? 2 : options.count
viewcachecount = options.count
})

Expand Down

0 comments on commit 5f3ca3e

Please sign in to comment.