fix : 修复组件外点击问题 修改样式

This commit is contained in:
zhangxiaolong
2022-04-13 17:47:09 +08:00
parent 52fbff49e2
commit 8214300cb1
2 changed files with 13 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
id="panel-calender"
:class="{ 'calendar--small': size === 'small' }"
class="calendar"
v-clickoutside="changeDropdownFlag"
>
<div @click="showDropdown" class="date-range-text">
@@ -63,6 +64,7 @@
@click="timeRange(searchTime)"
type="primary"
size="mini"
class="time-range-button el-button--primary"
>Apply time range</el-button
>
</div>
@@ -248,6 +250,11 @@ export default {
console.log(this.sign)
},
methods: {
changeDropdownFlag(){
if (this.dropdownFlag) {
this.dropdownFlag = false
}
},
getItem () {
this.rangeHistory = localStorage.getItem('date-range-history' + this.sign)
? JSON.parse(localStorage.getItem('date-range-history' + this.sign))