@stencil/vue-output-target
Advanced tools
Comparing version
@@ -140,7 +140,6 @@ 'use strict'; | ||
const emits = emitProps; | ||
const props = componentProps.reduce((acc, prop) => { | ||
acc[prop] = { type: null, default: EMPTY_PROP }; | ||
const props = [ROUTER_LINK_VALUE, ...componentProps].reduce((acc, prop) => { | ||
acc[prop] = DEFAULT_EMPTY_PROP; | ||
return acc; | ||
}, {}); | ||
props[ROUTER_LINK_VALUE] = { type: null, default: DEFAULT_EMPTY_PROP }; | ||
if (modelProp) { | ||
@@ -160,3 +159,3 @@ emits.push(UPDATE_VALUE_EVENT); | ||
emitProps.forEach((eventName) => { | ||
containerRef.value.addEventListener(eventName, (e) => { | ||
containerRef.value?.addEventListener(eventName, (e) => { | ||
emit(eventName, e); | ||
@@ -241,3 +240,3 @@ }); | ||
}; | ||
let propsToAdd = { | ||
const propsToAdd = { | ||
ref: containerRef, | ||
@@ -275,12 +274,6 @@ class: getElementClasses(containerRef, classes), | ||
if (props[MODEL_VALUE] !== EMPTY_PROP) { | ||
propsToAdd = { | ||
...propsToAdd, | ||
[modelProp]: props[MODEL_VALUE], | ||
}; | ||
propsToAdd[modelProp] = props[MODEL_VALUE]; | ||
} | ||
else if (modelPropValue !== EMPTY_PROP) { | ||
propsToAdd = { | ||
...propsToAdd, | ||
[modelProp]: modelPropValue, | ||
}; | ||
propsToAdd[modelProp] = modelPropValue; | ||
} | ||
@@ -293,6 +286,3 @@ } | ||
if (ROUTER_LINK_VALUE in props && props[ROUTER_LINK_VALUE] !== EMPTY_PROP) { | ||
propsToAdd = { | ||
...propsToAdd, | ||
href: props[ROUTER_LINK_VALUE], | ||
}; | ||
propsToAdd.href = props[ROUTER_LINK_VALUE]; | ||
} | ||
@@ -299,0 +289,0 @@ /** |
@@ -138,7 +138,6 @@ import { defineComponent, useSlots, createSSRApp, compile, ref, onMounted, getCurrentInstance, inject, h, withDirectives } from 'vue'; | ||
const emits = emitProps; | ||
const props = componentProps.reduce((acc, prop) => { | ||
acc[prop] = { type: null, default: EMPTY_PROP }; | ||
const props = [ROUTER_LINK_VALUE, ...componentProps].reduce((acc, prop) => { | ||
acc[prop] = DEFAULT_EMPTY_PROP; | ||
return acc; | ||
}, {}); | ||
props[ROUTER_LINK_VALUE] = { type: null, default: DEFAULT_EMPTY_PROP }; | ||
if (modelProp) { | ||
@@ -158,3 +157,3 @@ emits.push(UPDATE_VALUE_EVENT); | ||
emitProps.forEach((eventName) => { | ||
containerRef.value.addEventListener(eventName, (e) => { | ||
containerRef.value?.addEventListener(eventName, (e) => { | ||
emit(eventName, e); | ||
@@ -239,3 +238,3 @@ }); | ||
}; | ||
let propsToAdd = { | ||
const propsToAdd = { | ||
ref: containerRef, | ||
@@ -273,12 +272,6 @@ class: getElementClasses(containerRef, classes), | ||
if (props[MODEL_VALUE] !== EMPTY_PROP) { | ||
propsToAdd = { | ||
...propsToAdd, | ||
[modelProp]: props[MODEL_VALUE], | ||
}; | ||
propsToAdd[modelProp] = props[MODEL_VALUE]; | ||
} | ||
else if (modelPropValue !== EMPTY_PROP) { | ||
propsToAdd = { | ||
...propsToAdd, | ||
[modelProp]: modelPropValue, | ||
}; | ||
propsToAdd[modelProp] = modelPropValue; | ||
} | ||
@@ -291,6 +284,3 @@ } | ||
if (ROUTER_LINK_VALUE in props && props[ROUTER_LINK_VALUE] !== EMPTY_PROP) { | ||
propsToAdd = { | ||
...propsToAdd, | ||
href: props[ROUTER_LINK_VALUE], | ||
}; | ||
propsToAdd.href = props[ROUTER_LINK_VALUE]; | ||
} | ||
@@ -297,0 +287,0 @@ /** |
{ | ||
"name": "@stencil/vue-output-target", | ||
"version": "0.10.2", | ||
"version": "0.10.3", | ||
"description": "Vue output target for @stencil/core components.", | ||
@@ -5,0 +5,0 @@ "author": "Ionic Team", |
70549
-0.91%1328
-1.48%