github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/public/libs/vue-1.0.24/examples/todomvc/js/routes.js (about)

     1  /*global app, Router */
     2  
     3  (function (app, Router) {
     4  
     5  	'use strict';
     6  
     7  	var router = new Router();
     8  
     9  	['all', 'active', 'completed'].forEach(function (visibility) {
    10  		router.on(visibility, function () {
    11  			app.visibility = visibility;
    12  		});
    13  	});
    14  
    15  	router.configure({
    16  		notfound: function () {
    17  			window.location.hash = '';
    18  			app.visibility = 'all';
    19  		}
    20  	});
    21  
    22  	router.init();
    23  
    24  })(app, Router);