Vue使用vue-drag-resize生成懸浮拖拽小球
更新時間:2022年04月18日 08:13:49 作者:ckw@ldy
這篇文章主要為大家詳細介紹了Vue使用vue-drag-resize生成懸浮拖拽小球,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實例為大家分享了使用vue-drag-resize生成懸浮拖拽小球的具體代碼,供大家參考,具體內容如下
一、下載依賴
cnpm install ?vue-drag-resize
二、main.js引用
import VueDragResize from 'vue-drag-resize'
Vue.component('vue-drag-resize', VueDragResize)三、創(chuàng)建組件
<template>
? <vue-drag-resize id="moreModal"
? ? ? ? ? ? ? ? ? ?:isResizable="false"
? ? ? ? ? ? ? ? ? ?:w="50"
? ? ? ? ? ? ? ? ? ?:h="50"
? ? ? ? ? ? ? ? ? ?:x="100"
? ? ? ? ? ? ? ? ? ?:y="100"
? ? ? ? ? ? ? ? ? ?:z="10000"
? ></vue-drag-resize>
</template>
<script>
export default {
? name: "FloatBall"
}
</script>
<style scoped>
#moreModal {
? width: 50px;
? height: 50px;
? border-radius: 50%;
? background-color: #337AB7;
? line-height: 40px;
? text-align: center;
? color: #fff;
? opacity: 0.6;
? animation: light 2s ease-in-out infinite alternate;
? cursor: pointer
}
@keyframes light {
? from {
? ? box-shadow: 0 0 4px #1f8cfa;
? }
? to {
? ? box-shadow: 0 0 20px #1f8cfa;
? }
}
#moreModal.active:before {
? content: "";
? width: 100%;
? height: 100%;
? top: 0;
? left: 0;
? outline: none;
}
</style>四、展示

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
相關文章
在 Vue 3 中上傳 KML 文件并在地圖上顯示的實現(xiàn)方法
KML 文件作為一種標準的地理數(shù)據(jù)格式,廣泛應用于地理信息系統(tǒng)(GIS)中,通過 OpenLayers 和 Vue 3 的組合,您可以方便地實現(xiàn)地圖數(shù)據(jù)的可視化和交互,本文介紹在 Vue 3 中上傳 KML 文件并在地圖上顯示的實現(xiàn)方法,感興趣的朋友一起看看吧2024-12-12
vue中formdata傳值給后臺時參數(shù)為空的問題
這篇文章主要介紹了vue中formdata傳值給后臺時參數(shù)為空的問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2022-06-06

