【uniapp小程序】button组件去掉默认样式,转变为灵活的view

x33g5p2x  于2022-03-09 转载在 其他  
字(0.8k)|赞(0)|评价(0)|浏览(267)

【uniapp小程序】button组件去掉默认样式

参考:去掉默认样式

在小程序中需要button来进行开发功能的实现。但是button的默认样式,并不是项目中需要的。

html部分

<button type="default" open-type="getPhoneNumber" 
 @getphonenumber="decryptPhoneNumber" v-if="!userPhone">
	<div class="title">限时特价</div>
	<div class="price"><i>¥</i>{{activityInfo.price}}
		<span>¥{{activityInfo.basePrice}}</span>
	</div>
</button>

css部分
去除默认样式:

button::after{
 	border: none;
}
button{
	position: relative;
	display: block;
	margin-left: auto;
	margin-right: auto;
	padding-left: 0px;
	padding-right: 0px;
	box-sizing: border-box;
	// font-size: 18px;
	text-align: center;
	text-decoration: none;
	// line-height: 1;
	line-height: 1.35;
	// border-radius: 5px;
	-webkit-tap-highlight-color: transparent;
	overflow: hidden;
	color: #000000;
	background-color: #fff;
	width: 100%;
	height: 100%;
	}

相关文章

微信公众号

最新文章

更多