2021-09-14 07:31:59 +08:00
|
|
|
<template>
|
|
|
|
|
<div v-show="!!src">
|
|
|
|
|
<img @mouseup="onMouseUp" @mousedown="onMouseDown" :src="src">
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import { defineComponent, ref } from 'vue'
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
setup: () => {
|
|
|
|
|
const src = ref('/image/flag/Beidou.png')
|
|
|
|
|
const show_flag = (flag_name) => {
|
|
|
|
|
if (!flag_name) return
|
|
|
|
|
|
2021-12-09 15:06:40 +08:00
|
|
|
src.value = './image/flag/' + flag_name + '.png'
|
2021-09-14 07:31:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let exit_timeout = null
|
|
|
|
|
const exit = () => {
|
|
|
|
|
window.opener = window;
|
|
|
|
|
window.open('', '_self', '');
|
|
|
|
|
window.close();
|
|
|
|
|
}
|
|
|
|
|
const onMouseUp = () => {
|
|
|
|
|
if (exit_timeout) clearTimeout(exit_timeout)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onMouseDown = () => {
|
|
|
|
|
exit_timeout = setTimeout(exit, 10000)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return { src, show_flag, onMouseUp, onMouseDown }
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
img {
|
|
|
|
|
width: 169px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|