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

@stencil/vue-output-target

Package Overview
Dependencies
Maintainers
12
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stencil/vue-output-target - npm Package Compare versions

Comparing version 0.3.1-0 to 0.4.0-0

2

dist/generate-vue-component.js

@@ -26,3 +26,3 @@ import { dashToPascalCase } from './utils';

options.modelUpdateEvent = findModel.event;
options.externalModelUpdateEvent = findModel.externalEvent || findModel.event;
options.externalModelUpdateEvent = findModel.externalEvent;
}

@@ -29,0 +29,0 @@ if (Object.keys(options).length > 0) {

@@ -114,3 +114,3 @@ 'use strict';

options.modelUpdateEvent = findModel.event;
options.externalModelUpdateEvent = findModel.externalEvent || findModel.event;
options.externalModelUpdateEvent = findModel.externalEvent;
}

@@ -117,0 +117,0 @@ if (Object.keys(options).length > 0) {

@@ -105,3 +105,3 @@ import path from 'path';

options.modelUpdateEvent = findModel.event;
options.externalModelUpdateEvent = findModel.externalEvent || findModel.event;
options.externalModelUpdateEvent = findModel.externalEvent;
}

@@ -108,0 +108,0 @@ if (Object.keys(options).length > 0) {

@@ -12,3 +12,3 @@ export interface OutputTargetVue {

modelProp?: string;
modelUpdateEvent?: string;
modelUpdateEvent?: string | string[];
externalModelUpdateEvent?: string;

@@ -15,0 +15,0 @@ }

{
"name": "@stencil/vue-output-target",
"version": "0.3.1-0",
"version": "0.4.0-0",
"description": "Vue output target for @stencil/core components.",

@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js",

@@ -19,3 +19,3 @@ import { VNode, defineComponent, getCurrentInstance, h, inject, ref, Ref } from 'vue';

modelProp?: string;
modelUpdateEvent?: string;
modelUpdateEvent?: string | string[];
externalModelUpdateEvent?: string;

@@ -59,15 +59,18 @@ }

if (vnode.el) {
vnode.el.addEventListener(modelUpdateEvent.toLowerCase(), (e: Event) => {
modelPropValue = (e?.target as any)[modelProp];
emit(UPDATE_VALUE_EVENT, modelPropValue);
const eventsNames = Array.isArray(modelUpdateEvent) ? modelUpdateEvent : [modelUpdateEvent];
eventsNames.forEach((eventName: string) => {
vnode.el.addEventListener(eventName.toLowerCase(), (e: Event) => {
modelPropValue = (e?.target as any)[modelProp];
emit(UPDATE_VALUE_EVENT, modelPropValue);
/**
* We need to emit the change event here
* rather than on the web component to ensure
* that any v-model bindings have been updated.
* Otherwise, the developer will listen on the
* native web component, but the v-model will
* not have been updated yet.
*/
emit(externalModelUpdateEvent, e);
/**
* We need to emit the change event here
* rather than on the web component to ensure
* that any v-model bindings have been updated.
* Otherwise, the developer will listen on the
* native web component, but the v-model will
* not have been updated yet.
*/
emit(externalModelUpdateEvent, e);
});
});

@@ -74,0 +77,0 @@ }

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