使用uniapp内置easycom封装搜索框
This commit is contained in:
		
							parent
							
								
									4304089e6f
								
							
						
					
					
						commit
						959992b6ab
					
				
							
								
								
									
										18
									
								
								src/components/ygSearch/ygSearch.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/components/ygSearch/ygSearch.vue
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <view class="yg_search">
 | 
				
			||||||
 | 
					    <u-search placeholder="搜索" :show-action="false" ></u-search>
 | 
				
			||||||
 | 
					  </view>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					<style lang="scss">
 | 
				
			||||||
 | 
					  .yg_search {
 | 
				
			||||||
 | 
					    padding: 10rpx;
 | 
				
			||||||
 | 
					    background-color: #eb4450;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
@ -1,9 +1,7 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <view class="category">
 | 
					  <view class="category">
 | 
				
			||||||
    <!-- 1. 搜索 -->
 | 
					    <!-- 1. 搜索 -->
 | 
				
			||||||
    <view class="category_search">
 | 
					    <ygSearch></ygSearch>
 | 
				
			||||||
      <u-search placeholder="搜索" :show-action="false" ></u-search>
 | 
					 | 
				
			||||||
    </view>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <!-- 2. 内容 -->
 | 
					    <!-- 2. 内容 -->
 | 
				
			||||||
    <view class="category_content">
 | 
					    <view class="category_content">
 | 
				
			||||||
@ -86,10 +84,6 @@ export default {
 | 
				
			|||||||
  display: flex;
 | 
					  display: flex;
 | 
				
			||||||
  flex-direction: column;
 | 
					  flex-direction: column;
 | 
				
			||||||
  height: 100rpx;
 | 
					  height: 100rpx;
 | 
				
			||||||
  .category_search {
 | 
					 | 
				
			||||||
    padding: 10rpx;
 | 
					 | 
				
			||||||
    background-color: red;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  .category_content {
 | 
					  .category_content {
 | 
				
			||||||
    height: calc(100vh - 100rpx);
 | 
					    height: calc(100vh - 100rpx);
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,7 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <view>商品列表</view>
 | 
					  <view>
 | 
				
			||||||
 | 
					    <ygSearch></ygSearch>
 | 
				
			||||||
 | 
					  </view>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
 | 
				
			|||||||
@ -1,9 +1,7 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
	<view class="content">
 | 
						<view class="content">
 | 
				
			||||||
    <!-- 1.搜索栏 -->
 | 
					    <!-- 1.搜索栏 -->
 | 
				
			||||||
    <view class="search">
 | 
					    <ygSearch></ygSearch>
 | 
				
			||||||
      <u-search placeholder="搜索" :show-action="false"></u-search>
 | 
					 | 
				
			||||||
    </view>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <!-- 2.轮播图 -->
 | 
					    <!-- 2.轮播图 -->
 | 
				
			||||||
    <view class="swiper">
 | 
					    <view class="swiper">
 | 
				
			||||||
@ -87,19 +85,6 @@
 | 
				
			|||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<style lang="scss">
 | 
					<style lang="scss">
 | 
				
			||||||
  /* 搜索 */
 | 
					 | 
				
			||||||
  .search {
 | 
					 | 
				
			||||||
    /* 
 | 
					 | 
				
			||||||
    设计稿375px
 | 
					 | 
				
			||||||
    375px = 750rpx
 | 
					 | 
				
			||||||
    5px = 10rpx
 | 
					 | 
				
			||||||
    */
 | 
					 | 
				
			||||||
    padding: 10rpx;
 | 
					 | 
				
			||||||
    background-color: #eb4450;
 | 
					 | 
				
			||||||
    /* 
 | 
					 | 
				
			||||||
    轮播图750px宽, 340px高
 | 
					 | 
				
			||||||
     */
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /* 导航 */
 | 
					  /* 导航 */
 | 
				
			||||||
  .nav {
 | 
					  .nav {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user