父页面
// template
<view class="search">
<view class="search_top">
<view class="head_search ">
<image class="search_img" src="../../static/img/index/search_img.png"></image>
<input class="uni-input " type="search" cursor="2" placeholder-class="drawInputPlacehold" placeholder="请输入商家、活动或者城市" @keyup.enter="enterFn(searVal)" v-model="searVal" />
</view>
</view>
<searchList :searchVal="searVal" class="search-list"></searchList>
</view>
// 父页面中样式
<style lang="scss" scoped>
.search{
width: 100%;
min-height: 100%;
background: #F5F6FA;
.search-list /deep/ .searchss{
font-size: 32rpx;
color: red;
}
}
</style>
子组件中 template
// template
<view class="search-list">
<view class="searchss ">321321321312</view>
</view>
// 子组件中样式
<style lang="scss">
.search-list{
width: 100%;
padding: 0 20rpx;
margin-top: 20rpx;
box-sizing: border-box;
.searchss{
font-size: 32rpx;
color: yellow;
}
}
</style>
H5中最终展示
小程序中最终展示