1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <template>
- <view class="">
- <view :class="['search-box' , fixed ?'fixed-search':'' ]"
- :style="{'height':searchHeight + 'rpx' , 'top':nav_status_Height+'px' , 'backgroundColor':bgColor}">
- <u-search placeholder="请输入搜索关键字" v-model="keyword" @search="searchData" :show-action="false"
- :height="82"></u-search>
- </view>
- <view :style="{'width': '100%' , 'height' : searchHeight + 'rpx'}" />
- </view>
- </template>
- <script>
- import {
- boolean
- } from 'mathjs';
- let app = getApp();
- export default {
- name: "zw-search",
- props: {
- placeholder: {
- type: String,
- default: '搜索'
- },
- bgColor: {
- type: String,
- default: '#fff'
- },
- searchHeight: {
- type: Number,
- default: 100
- },
- fixed: {
- type: Boolean,
- default: true
- }
- },
- data() {
- return {
- // nav_status_Height: 0,
- nav_status_Height: app.globalData.nav_status_Height,
- keyword: '',
- };
- },
- created() {
- },
- methods: {
- searchData() {}
- }
- }
- </script>
- <style lang="scss" scoped>
- .search-box {
- padding: 0 30rpx;
- display: flex;
- align-items: center;
- }
- .fixed-search {
- position: fixed;
- left: 0;
- right: 0;
- z-index: 1;
- }
- </style>
|