Socket
Socket
Sign inDemoInstall

popup-supwisdom

Package Overview
Dependencies
0
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    popup-supwisdom

一款弹框浮层的插件


Version published
Weekly downloads
6
increased by100%
Maintainers
2
Install size
81.0 kB
Created
Weekly downloads
 

Readme

Source

popup.js

一款弹框浮层的插件

已默认自动识别三端,为了防止识别无效,支持自定义设置当前所在端
集成方式1: npm安装
    npm i popup-supwisdom --save
    
    import('popup-supwisdom/popup.css')
    var EvaPopup = require('popup-supwisdom/popup.js')
集成方式2: cdn引入

evaluation-center.dev2.supwisdom.com 按照各个学校的实际路径地址调整

    <!-- 引入样式 -->
    <link rel="stylesheet" href="http://evaluation-center.dev2.supwisdom.com/eva-plugin/popup.css">
    <!-- 引入组件库 -->
    <script src="http://evaluation-center.dev2.supwisdom.com/eva-plugin/popup.js"></script>
最简用法示例

evaluation-center.dev2.supwisdom.com 按照各个学校的实际路径地址调整

    new EvaPopup({
        objKey: '2323', // 对象key 必传
        token: '', // token值 必传
        requestUrl: 'https://evaluation-center.dev2.supwisdom.com', // 评价中台服务url 必传
        userAgent: 'pc', // 系统自动获取所在端,支持自定义当前所在端 参数app,pc,wx 非必传,不传根据当前页面的userAgent判断
    })
完整用法示例

evaluation-center.dev2.supwisdom.com 按照各个学校的实际路径地址调整

    var pop = new EvaPopup({
        objKey: '2323', // 对象key 必传
        token: '', // token值 必传
        requestUrl: 'https://evaluation-center.dev2.supwisdom.com', // 评价中台服务url 必传
        userAgent: 'pc', // 系统自动获取所在端,支持自定义当前所在端 参数app,pc,wx 非必传,不传根据当前页面的userAgent判断
        title: '',  // 支持自定义传标题 非必传,不传则取document.getElementsByTagName('title')[0].innerText
        url: '', // 支持自定义传所在页面的url 非必传,不传则取location.href
        answers: function () {
            console.log('点击 "小希问答" 按钮时的回调,可不定义')
        },
        evaluation: function () {
            console.log('点击 "服务评价" 按钮时的回调,可不定义')
        },
        feedback: function () {
            console.log('点击 "咨询反馈" 按钮时的回调,可不定义')
        }
    })

    // 监听事件
    pop.on('answers', function () {
        console.log('点击 "小希问答" 按钮时的监听,可不定义')
    })
    pop.on('evaluation', function () {
        console.log('点击 "服务评价" 按钮时的监听,可不定义')
    })
    pop.on('feedback', function () {
        console.log('点击 "咨询反馈" 按钮时的监听,可不定义')
    })

API

Props
参数说明类型默认值可选值是否必填
objKey对象keyString' '-
tokentoken值String' '-
requestUrl评价中台服务urlString' '-
userAgent系统自动获取所在端,支持自定义当前所在端 参数 非必传-系统自动获取app,pc,wx
title自定义标题String当前页面的title-
url自定义传所在页面的urlString当前页面的url-
Events
事件名说明回调函数
answers点击问答时触发-
evaluation点击评价时触发-
feedback点击咨询反馈时触发-

Keywords

FAQs

Last updated on 03 Apr 2024

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc