New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

floating-ball

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

floating-ball

#### 方式 1 npm i floating-ball

latest
npmnpm
Version
0.2.8
Version published
Maintainers
1
Created
Source

快速使用

方式 1 npm i floating-ball

import FloatingBall from "floating-ball";
const floatingBall = new FloatingBall({
  panelEvents: [
    {
      actionType: "text",
      actionText: "负责人:张老师\n1560000111",
    },
    {
      actionType: "link",
      actionText: "校园智能助手",
      actionLink: "https://yiyan.baidu.com/welcome",
    },
  ],
});
// 可在页面销毁时调用一下方法移除悬浮球
floatingBall.removeFloatingBall();
入参是否必填描述类型
icon悬浮球图标string
bottom悬浮球距离底部偏移量number
right悬浮球距离右侧偏移量number
scrollEl页面滚动元素HTMLElement
width浮球宽度number
height浮球高度number
panelEvents悬浮球面板详情(不传则不会显示面板)Array
panelEvents 元素类型
入参是否必填描述类型
actionType面板元素类型"link" 或 "text"
actionLinkactionType 为 link 时必填面板元素跳转链接string
actionText面板元素文案string

方式 2 script 引入

<script src="https:XXXXX/index.umd.js"></script>

<script>
  const floatingBall = new window.floatingBall({
    panelEvents: [
      {
        actionType: "text",
        actionText: "负责人:张老师\n1560000111"
      },
      {
        actionType: "link",
        actionText: "校园智能助手",
        actionLink: "https://yiyan.baidu.com/welcome"
      }
    ]})
</script>

方式 3 在项目中引入打包后的文件,

import FloatingBall from "@/utils/floating-ball";

const floatingBall = new FloatingBall({
  panelEvents: [
    {
      actionType: "text",
      actionText: "负责人:张老师\n1560000111",
    },
    {
      actionType: "link",
      actionText: "校园智能助手",
      actionLink: "https://yiyan.baidu.com/welcome",
    },
  ],
});

FAQs

Package last updated on 19 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts