|
@@ -18,7 +18,8 @@
|
|
|
@mouseenter="iptMouseenter"/>
|
|
|
|
|
|
<template v-if="currentIptIndex == index && userList.length">
|
|
|
- <div class="user-list-wrapper">
|
|
|
+ <div class="user-list-wrapper"
|
|
|
+ :style="{ left: domStyle.left + 'px', top: domStyle.top + 'px' }">
|
|
|
<div class="item"
|
|
|
v-for="(item, index) in userList"
|
|
|
:key="index"
|
|
@@ -79,6 +80,10 @@ const props = defineProps({
|
|
|
let currentIptIndex = ref(-1);
|
|
|
let isActiveAddBtn = ref(false);
|
|
|
let currentUserIndex = ref(-1);
|
|
|
+let domStyle = ref({
|
|
|
+ left: 0,
|
|
|
+ top: 0
|
|
|
+})
|
|
|
|
|
|
let userList = ref([]);
|
|
|
let userInfo = reactive({});
|
|
@@ -202,9 +207,13 @@ const iptMouseenter = (e) => {
|
|
|
rectClick(e);
|
|
|
}
|
|
|
|
|
|
-function rectClick(event) {
|
|
|
+const rectClick = (event) => {
|
|
|
//获取相对于当前所指向对象的位置坐标
|
|
|
console.log(event,'x:' + event.clientX + " y:" + event.clientY);
|
|
|
+ domStyle.value = {
|
|
|
+ left : event.clientX / 2,
|
|
|
+ top: event.clientY
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const getTwitterUsers = (query, cb) => {
|
|
@@ -293,7 +302,7 @@ const onUserMouseLeave = (params, index) => {
|
|
|
.user-list-wrapper {
|
|
|
width: 284px;
|
|
|
max-height: 430px;
|
|
|
- position: absolute;
|
|
|
+ position: fixed;
|
|
|
box-shadow: 0px 4px 20px 0px #0000004D;
|
|
|
overflow-y: scroll;
|
|
|
background-color: #fff;
|