Vue使用vue-drag-resize生成懸浮拖拽小球
更新時間:2022年04月18日 08:13:49 作者:ckw@ldy
這篇文章主要為大家詳細(xì)介紹了Vue使用vue-drag-resize生成懸浮拖拽小球,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實(shí)例為大家分享了使用vue-drag-resize生成懸浮拖拽小球的具體代碼,供大家參考,具體內(nèi)容如下
一、下載依賴
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>四、展示

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
在 Vue 3 中上傳 KML 文件并在地圖上顯示的實(shí)現(xiàn)方法
KML 文件作為一種標(biāo)準(zhǔn)的地理數(shù)據(jù)格式,廣泛應(yīng)用于地理信息系統(tǒng)(GIS)中,通過 OpenLayers 和 Vue 3 的組合,您可以方便地實(shí)現(xiàn)地圖數(shù)據(jù)的可視化和交互,本文介紹在 Vue 3 中上傳 KML 文件并在地圖上顯示的實(shí)現(xiàn)方法,感興趣的朋友一起看看吧2024-12-12
vue中formdata傳值給后臺時參數(shù)為空的問題
這篇文章主要介紹了vue中formdata傳值給后臺時參數(shù)為空的問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2022-06-06
vue 頁面跳轉(zhuǎn)的實(shí)現(xiàn)方式
這篇文章主要介紹了vue 頁面跳轉(zhuǎn)的實(shí)現(xiàn)方式,幫助大家更好的理解和使用vue,感興趣的朋友可以了解下2021-01-01
vue3.0關(guān)閉eslint校驗(yàn)的3種方法詳解
這篇文章主要給大家介紹了關(guān)于vue3.0關(guān)閉eslint校驗(yàn)的3種方法,在實(shí)際開發(fā)過程中,eslint的作用不可估量,文中將關(guān)閉的方法介紹的非常詳細(xì),需要的朋友可以參考下2023-06-06

