56 lines
1.2 KiB
Vue
56 lines
1.2 KiB
Vue
<template>
|
|
<div class="content">
|
|
<img src="@/assets/img/location.png">
|
|
<input type="text"
|
|
placeholder="请输入搜索位置/坐标">
|
|
<img src="@/assets/img/search.png"
|
|
@click="showList()">
|
|
</div>
|
|
<div ref="locationList"
|
|
class="locationList" />
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
methods: {
|
|
showList () {
|
|
if (this.$refs.locationList.className == 'locationList my-click-transition') {
|
|
this.$refs.locationList.className = 'locationList'
|
|
} else {
|
|
this.$refs.locationList.className = 'locationList my-click-transition'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.content {
|
|
width: 300px;
|
|
height: 45px;
|
|
padding: 10px 10px;
|
|
background-color: rgba(245, 245, 245, 0.8);
|
|
box-shadow: 0px 15px 10px -15px #565656;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
|
|
input {
|
|
padding-left: 10px;
|
|
}
|
|
}
|
|
// 位置列表
|
|
.locationList {
|
|
margin-top: 5px;
|
|
width: 300px;
|
|
height: 100px;
|
|
background-color: pink;
|
|
transform: scale(0.5, 0.5);
|
|
opacity: 0;
|
|
transition: transform 0.5s linear, opacity 0.5s linear;
|
|
}
|
|
.my-click-transition {
|
|
opacity: 1;
|
|
transform: scale(1, 1);
|
|
}
|
|
</style>
|