Commit 6084b83d by liudx

解决onblur和onclick冲突

parent e79a3721
......@@ -260,6 +260,7 @@ export default {
name: "company",
data() {
return {
timer:null,
search_result_show: false,
zh_CN,
search_result: [],
......@@ -608,7 +609,9 @@ export default {
}
},
onBlur() {
timer = setTimeout(() => {
this.search_result_show = false;
}, 150);
},
//从联想结果打开公司页面
lenovnoCompanyDetails(item) {
......@@ -708,7 +711,7 @@ export default {
.search_result {
position: absolute;
width: calc(100% - 120px);
height: 300px;
// height: 300px;
top: 54px;
left: 0;
background-color: #fff;
......@@ -716,7 +719,7 @@ export default {
box-shadow: 0px 5px 5px 2px rgba(0, 0, 0, 0.05);
.search_result_item {
// height: 45px;
padding: 15px 15px 15px 25px;
padding: 15px 5px 15px 25px;
font-family: "SF Pro Text";
font-size: 16px;
}
......
......@@ -45,13 +45,13 @@
<div style="position: relative">
<div
v-if="patent_cate == 'title'"
style="cursor: pointer"
style="cursor: pointer; width: 80%"
v-html="item.title"
@click="lenovnoPatentDetails(item)"
></div>
<div
v-else
style="cursor: pointer"
style="cursor: pointer; width: 80%"
v-html="item.gkh"
@click="lenovnoPatentDetails(item)"
></div>
......@@ -71,7 +71,6 @@
@input="onInput(tab_id)"
@blur="onBlur"
@focus="onFocus(tab_id)"
>
<template #enterButton>
<img
......@@ -91,13 +90,13 @@
<div style="position: relative">
<div
v-if="company_cate == 'company_name'"
style="cursor: pointer"
style="cursor: pointer; width: 80%"
v-html="item.company_name"
@click="lenovnoCompanyDetails(item)"
></div>
<div
v-else
style="cursor: pointer"
style="cursor: pointer; width: 80%"
v-html="item.company_name"
@click="lenovnoCompanyDetails(item)"
></div>
......@@ -240,6 +239,7 @@ export default {
data() {
return {
tab_id: "1",
timer: null,
patent_cate: "",
company_cate: "",
search_result_show: false,
......@@ -335,6 +335,7 @@ export default {
},
//从联想结果打开专利页面
lenovnoPatentDetails(item) {
clearTimeout(this.timer);
this.$router.push({
path: "/patentDetails",
query: {
......@@ -344,6 +345,7 @@ export default {
},
//从联想结果打开公司页面
lenovnoCompanyDetails(item) {
clearTimeout(this.timer);
this.$router.push({
path: "/companyDetails",
query: {
......@@ -468,7 +470,9 @@ export default {
}
},
onBlur() {
timer = setTimeout(() => {
this.search_result_show = false;
}, 150);
},
},
mounted() {},
......@@ -570,7 +574,7 @@ export default {
.search_result {
position: absolute;
width: calc(100% - 120px);
height: 300px;
// height: 300px;
top: 54px;
left: 0;
background-color: #fff;
......@@ -578,7 +582,7 @@ export default {
box-shadow: 0px 5px 5px 2px rgba(0, 0, 0, 0.05);
.search_result_item {
// height: 45px;
padding: 15px 15px 15px 25px;
padding: 15px 5px 15px 25px;
font-family: "SF Pro Text";
font-size: 16px;
}
......
......@@ -35,7 +35,7 @@
<div style="position: relative">
<div
v-if="patent_cate == 'title'"
style="cursor: pointer"
style="cursor: pointer;width: 80%;"
v-html="item.title"
@click="lenovnoPatentDetails(item)"
></div>
......@@ -162,6 +162,7 @@ export default {
name: "patent",
data() {
return {
timer:null,
zh_CN,
search_result_show: false,
search_result: [],
......@@ -402,16 +403,20 @@ export default {
},
//onBlur
onBlur() {
timer = setTimeout(() => {
this.search_result_show = false;
}, 150);
},
//从联想结果打开专利页面
lenovnoPatentDetails(item) {
this.$router.push({
path: "/patentDetails",
query: {
id: item.mysql_id,
},
});
// this.search_result_show = false;
},
},
watch: {
......@@ -495,7 +500,7 @@ export default {
.search_result {
position: absolute;
width: calc(100% - 120px);
height: 300px;
// height: 300px;
top: 54px;
left: 0;
background-color: #fff;
......@@ -503,9 +508,10 @@ export default {
box-shadow: 0px 5px 5px 2px rgba(0, 0, 0, 0.05);
.search_result_item {
// height: 45px;
padding: 15px 15px 15px 25px;
padding: 15px 5px 15px 25px;
font-family: "SF Pro Text";
font-size: 16px;
}
.search_result_item:hover {
background-color: #f5fbff;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment