keystonejs/keystone-classic

keystonejs 4 beta file system storage adapter image preview

開放

#3,781 建立於 2016年12月11日

 (5 則留言) (0 個反應) (0 位負責人)JavaScript (2,288 個分叉)batch import
discussionhelp wanted

倉庫指標

星標
 (14,656 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

I want preview the upload file that is image

Gallery.add({
	name: { type: String, required: true },
	publishedDate: { type: Date, default: Date.now },
	image: { 
		type: Types.File, 
		storage: storage,
		format: function(item, file){
			return '<pre>'+JSON.stringify(file, false, 2)+'</pre>'+
				'<img src="'+file.url+'" style="max-width: 300px">'
		}
	},
});

I think i can not use the format function , because it is old function for ver 3 how can i do it

貢獻者指南