|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="main-search" @touchstart="cancelFocus">
|
|
|
+ <div class="main-search" @touchstart="cancelFocus" id="main-search">
|
|
|
<div class="main-search-header">
|
|
|
<input type="text" id="search-box" v-model="keyword" placeholder="请输入您要查找的型号或品牌" @keyup.13="onSearch()">
|
|
|
<span @click="onSearch()">搜索</span>
|
|
|
@@ -112,6 +112,14 @@
|
|
|
},
|
|
|
mounted () {
|
|
|
document.getElementById('search-box').focus()
|
|
|
+ let height = window.innerHeight
|
|
|
+ window.onresize = function () {
|
|
|
+ if (window.innerHeight < height) {
|
|
|
+ document.getElementById('main-search').style.bottom = (window.innerHeight - height) / (document.documentElement.clientWidth / 750) + 'rem'
|
|
|
+ } else {
|
|
|
+ document.getElementById('main-search').style.bottom = 0
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
'keyword': function (val, oldVal) {
|