绿藻头常用的两种搜索

第一种
在这里插入图片描述
html部分

<view class="search">
<input type="text" placeholder="请输入课程名称" v-model="searchInfo" />
<button>搜索</button>
</view>

js部分

<script>
	export default {
		data() {
			return {
			             searchInfo:''
			         }
		      }
	}
</script>

css部分

<style lang="scss">
.search {
	width: 68%;
	height: 60rpx;
	font-size: 26rpx;
	display: flex;
	margin-left: 20rpx;
    input {
		box-sizing: border-box;
		width: 80%;
		height: 60rpx;
		border: none;
		padding: 5rpx 20rpx;
		border-radius: 10rpx 0 0 10rpx;
		background-color: #fff;
		}

	button {
		width: 20%;
		height: 60rpx;
		line-height: 55rpx;
		border: none;
		font-size: 26rpx;
		padding: 0 10rpx;
		color: #fff;
		border-radius: 0 10rpx 10rpx 0;
		background-color: #517cc8;
		}
	}
</style>

第二种 跟项目里有点小改动 布局上可能会有点问题:D
在这里插入图片描述
html部分

<view class="searchbar">
			<input type="text" v-model="searchInfo" />
			<text class="iconfont search">&#xe6ad;</text>
			<!--这是一个小麦克风图标,项目里后来没用到,所以图中没显示,用的是阿里图标,用的话可以把注释打开:D-->
			<!-- <text class="iconfont micphone">&#xe736;</text> -->
			<button @click="mysearch">搜索</button>
</view>

js部分

<script>
	export default {
		data() {
			return {
			             searchInfo:''
			         }
		      }
	}
</script>

css部分

<style lang="scss">
.searchbar {
				position: relative;
				display: flex;
				justify-content: space-around;
				align-items: center;
				width: 750rpx;
				height: 80rpx;
				padding: 0 20rpx;
				background-color: #fff;

				input {
					width: 70%;
					height: 60rpx;
					box-sizing: border-box;
					padding: 10rpx 80rpx;
					border-radius: 50rpx;
					background-color: #eaeff9;
				}

				.search {
					position: absolute;
					left: 9vw;
				}

				.micphone {
					position: absolute;
					left: 49vw;
				}

				.clock {
					font-size: 50rpx;
					font-weight: 550;
				}

				button {
					position: absolute;
					left: 55vw;
					width: 120rpx;
					height: 50rpx;
					line-height: 50rpx;
					border: none;
					border-radius: 50rpx;
					font-size: 24rpx;
					color: #fff;
					z-index: 30;
					background-image: linear-gradient(to right, #ff9d3e, #e6750f);
				}
			}
</style>
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值