diff --git a/src/modules/layer.js b/src/modules/layer.js index 93c89568..9ab219b5 100644 --- a/src/modules/layer.js +++ b/src/modules/layer.js @@ -1202,7 +1202,7 @@ var cache = layer.cache||{}, skin = function(type){ //仿系统prompt layer.prompt = function(options, yes){ - var style = ''; + var style = '', placeholder = ''; options = options || {}; if(typeof options === 'function') yes = options; @@ -1212,8 +1212,11 @@ layer.prompt = function(options, yes){ style = 'style="width: '+ area[0] +'; height: '+ area[1] + ';"'; delete options.area; } - var prompt, content = options.formType == 2 ? '' : function(){ - return ''; + if (options.placeholder) { + placeholder = ' placeholder="' + options.placeholder + '"'; + } + var prompt, content = options.formType == 2 ? '' : function () { + return ''; }(); var success = options.success;