【uniapp】小程序中input输入框的placeholder-class不生效以及解决办法

 input框中的placeholder属性是可以更改样式,更改的方式为placeholder-class="你的style名"

例如我的:

<view class="top_one">

<text>收货人</text> <input type="text" placeholder="名字"

//(注释)这里---- placeholder_text

 placeholder-class="placeholder_text"/>

</view>

<view class="top_two">
	<text>手机号码</text><input type="number" placeholder="手机号" />
</view>
.placeholder_text {
		font-family: 'Source Han Sans CN';
		font-weight: 350;
		font-size: 24rpx;
		color: #747474;
	}

但是这个属性如果使用了<style scoped>就不生效,所以我们可以单独再写一个style

 就ok了 ^q^

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值