2020-02-09 09:59:00 -08:00
|
|
|
<template>
|
|
|
|
<div class="fgmtyycl _panel" :style="{ top: top + 'px', left: left + 'px' }" @mouseover="() => { $emit('mouseover'); }" @mouseleave="() => { $emit('mouseleave'); }">
|
2020-02-09 10:13:24 -08:00
|
|
|
<x-url-preview :url="url"/>
|
2020-02-09 09:59:00 -08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
import i18n from '../i18n';
|
|
|
|
import XUrlPreview from './url-preview.vue';
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
i18n,
|
|
|
|
|
|
|
|
components: {
|
|
|
|
XUrlPreview
|
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
url: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
source: {
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
u: null,
|
|
|
|
top: 0,
|
|
|
|
left: 0,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
const rect = this.source.getBoundingClientRect();
|
|
|
|
const x = ((rect.left + (this.source.offsetWidth / 2)) - (300 / 2)) + window.pageXOffset;
|
|
|
|
const y = rect.top + this.source.offsetHeight + window.pageYOffset;
|
|
|
|
|
|
|
|
this.top = y;
|
|
|
|
this.left = x;
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.fgmtyycl {
|
|
|
|
position: absolute;
|
|
|
|
z-index: 11000;
|
2020-02-09 10:13:24 -08:00
|
|
|
width: 500px;
|
2020-02-09 09:59:00 -08:00
|
|
|
overflow: hidden;
|
2020-02-09 10:13:24 -08:00
|
|
|
pointer-events: none;
|
2020-02-09 09:59:00 -08:00
|
|
|
}
|
|
|
|
</style>
|