Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

next-venders

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-venders - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

index.js

@@ -1,1 +0,1 @@

export { listener,setEventName,renderParams } from './VueListener';
export { listener,setEventName,renderParams,emitEvent } from './VueListener';
{
"name": "next-venders",
"version": "0.0.1",
"version": "0.0.2",
"description": "js utils ",

@@ -10,3 +10,6 @@ "main": "index.js",

"author": "meyun",
"license": "MIT"
"license": "MIT",
"dependencies": {
"vue": "^2.6.14"
}
}

@@ -29,3 +29,6 @@

// 事件广播
emitEvent("eventName","msg");
```
"use strict";
exports.__esModule = true;
exports.renderParams = exports.setEventName = exports.listener = void 0;
exports.emitEvent = exports.renderParams = exports.setEventName = exports.listener = void 0;
var vue_1 = require("vue");
var EventBus = new vue_1["default"]();
var VueListener = /** @class */ (function () {

@@ -14,6 +16,4 @@ function VueListener() {

// 卸载监听,防止多次监听
this.$off(_this.event);
},
mounted: function () {
this.$on(_this.event, function (key) {
EventBus.$off(_this.event);
EventBus.$on(_this.event, function (key) {
if (_this.storage[key]) {

@@ -23,2 +23,4 @@ _this.storage[key].isActive = true;

});
},
mounted: function () {
}

@@ -61,1 +63,2 @@ };

exports.renderParams = VueListenerInstance.renderParams;
exports.emitEvent = EventBus.$emit;

@@ -1,2 +0,2 @@

import Vue from 'vue';
declare interface StorageObject {

@@ -9,6 +9,6 @@ params:any;

}
const EventBus:Vue = new Vue();
class VueListener {
storage:StorageApi;
event:String;
event:string;
constructor(){

@@ -25,6 +25,4 @@ this.storage = {};

// 卸载监听,防止多次监听
this.$off(_this.event)
},
mounted(){
this.$on(_this.event,(key:string)=>{
EventBus.$off(_this.event);
EventBus.$on(_this.event,(key:string)=>{
if(_this.storage[key]){

@@ -34,2 +32,5 @@ _this.storage[key].isActive = true;

})
},
mounted(){
}

@@ -69,2 +70,4 @@ };

export const renderParams = VueListenerInstance.renderParams;
export const renderParams = VueListenerInstance.renderParams;
export const emitEvent = EventBus.$emit;
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc