Vue生成悬浮拖拽小球

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

Vue生成悬浮拖拽小球

ckw@ldy   2022-05-28 我要评论

一、下载依赖

cnpm install  vue-drag-resize

二、main.js引用

import VueDragResize from 'vue-drag-resize'
Vue.component('vue-drag-resize', VueDragResize)

三、创建组件

<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>

四、展示

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们