去除button默认样式、修改input placeholder样式、搜索input、按钮禁用样式

4 阅读1分钟

去除button默认样式

button {
    padding: 0;
    margin: 0;
    border: none;
    line-height: 1;
}
button::after {
    border: none;
}

修改input placeholder样式

<view class="input-wrap">
    <input type="number" v-model="account" placeholder="请输入账号" placeholder-class="input-placeholder"/>
</view>

<style lang="scss" scoped>
    .input-wrap {
        /deep/ .input-placeholder {
            font-weight: 400;
            font-size: 24rpx;
            color: #848484;
        }
	}
</style>

搜索input

<input type="text" v-model="keyword" placeholder="请输入搜索内容" confirm-type="search" @confirm="search">

按钮禁用样式

.disabled-btn {
    opacity: 0.5;
    position: relative;
    pointer-events: none;
}
.disabled-btn::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
}