mirror of
https://github.com/wu736139669/vczero.github.io.git
synced 2026-08-05 06:23:38 +00:00
add link
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
tpl渲染博客内容
|
||||
*/
|
||||
|
||||
$(function(){
|
||||
seajs.use('./blog/blogs.js', function(exports){
|
||||
var blogs = exports.blogs;
|
||||
createBlogs(blogs, 100);
|
||||
});
|
||||
|
||||
function createBlogs(blogs, n){
|
||||
var blogs = blogs;
|
||||
var num = n > blogs.length ? blogs.length:n;
|
||||
var element = $('#showblog');
|
||||
var tpl = $('#tpl_blog').html();
|
||||
var myBlogs = [];
|
||||
for(var i = 0; i < num; i++){
|
||||
myBlogs.push(blogs[i]);
|
||||
}
|
||||
var data = {
|
||||
list: myBlogs
|
||||
}
|
||||
var html = _.template(tpl, data);
|
||||
element.html(html);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user