next-venders
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -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; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11001
187
33
1
+ Addedvue@^2.6.14
+ Added@babel/helper-string-parser@7.25.9(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@babel/parser@7.26.2(transitive)
+ Added@babel/types@7.26.0(transitive)
+ Added@vue/compiler-sfc@2.7.16(transitive)
+ Addedcsstype@3.1.3(transitive)
+ Addednanoid@3.3.7(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpostcss@8.4.47(transitive)
+ Addedprettier@2.8.8(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsource-map-js@1.2.1(transitive)
+ Addedvue@2.7.16(transitive)