"search":"/components/search/search"
// components/search/search.js Component({ properties: { innerText:{ type: String, value: '搜索', } }, data: { }, methods: { redirect(){ wx.navigateTo({ url: '/pages/chazhao/chazhao', success:(res)=>{ console.log(res); }, fail(res){ console.log(res); } }) } } })
<view class="search" bind:tap="redirect"> <navigator> <icon type="search" size="40rpx"></icon> <view class="inner">{{innerText}}</view> </navigator> </view>
.search{ height: 110rpx; background-color: red; display: flex; justify-content: center; align-items: center; position: fixed; left: 0; top: 0; width: 100%; z-index: 999; } .search navigator{ height: 90rpx; width: 95%; display: flex; background-color: #fff; justify-content: center; align-items: center; border-radius: 10rpx; }
标签:search,console,center,color,res,height From: https://www.cnblogs.com/yhgz/p/17779755.html