追格圈子小程序中如何调整input的默认提示状态

追格官方小助手/ 2022年10月10日/ CSS教程/ 浏览 1456

在追格微信小程序中,有些用户在调整模板的时候,会有input输入框默认状态和背景色相对冲突比较明显的情况,但按照之前web上的经验修改placeholder伪类又无效。


因为在微信小程序中,input标签增加了几个placeholder专用属性


placeholder - 输入框为空时占位符

类型:string

placeholder-style - 指定 placeholder 的样式

类型:string


placeholder-class - 指定 placeholder 的样式类

类型:string 默认值:input-placeholder


在应用中,我们设置input相关属性即可,例如


<input confirm-type="search" placeholder="请输入关键词..." auto-focus="ture" placeholder-class="input-plholder" />


这样我们可以通过定制style来控制显示


也可以通过这种方式来调整



<input confirm-type="search" placeholder="请输入关键词..." auto-focus="ture" placeholder-style="color: #ff6600; background: #333333" />


发表评论

暂无评论,抢个沙发...

客服 工单