@stencil/vue-output-target
Advanced tools
Comparing version 0.4.2-0 to 0.4.2-1
@@ -22,12 +22,6 @@ import { dashToPascalCase } from './utils'; | ||
} | ||
let options = {}; | ||
const findModel = componentModelConfig && componentModelConfig.find(config => config.elements.includes(cmpMeta.tagName)); | ||
if (findModel) { | ||
options.modelProp = findModel.targetAttr; | ||
options.modelUpdateEvent = findModel.event; | ||
options.externalModelUpdateEvent = findModel.externalEvent; | ||
} | ||
if (Object.keys(options).length > 0) { | ||
templateString += `,\n`; | ||
templateString += JSON.stringify(options, null, 2); | ||
templateString += `'${findModel.targetAttr}', '${findModel.event}', '${findModel.externalEvent}'`; | ||
} | ||
@@ -34,0 +28,0 @@ templateString += `);\n`; |
@@ -110,12 +110,6 @@ 'use strict'; | ||
} | ||
let options = {}; | ||
const findModel = componentModelConfig && componentModelConfig.find(config => config.elements.includes(cmpMeta.tagName)); | ||
if (findModel) { | ||
options.modelProp = findModel.targetAttr; | ||
options.modelUpdateEvent = findModel.event; | ||
options.externalModelUpdateEvent = findModel.externalEvent; | ||
} | ||
if (Object.keys(options).length > 0) { | ||
templateString += `,\n`; | ||
templateString += JSON.stringify(options, null, 2); | ||
templateString += `'${findModel.targetAttr}', '${findModel.event}', '${findModel.externalEvent}'`; | ||
} | ||
@@ -122,0 +116,0 @@ templateString += `);\n`; |
@@ -101,12 +101,6 @@ import path from 'path'; | ||
} | ||
let options = {}; | ||
const findModel = componentModelConfig && componentModelConfig.find(config => config.elements.includes(cmpMeta.tagName)); | ||
if (findModel) { | ||
options.modelProp = findModel.targetAttr; | ||
options.modelUpdateEvent = findModel.event; | ||
options.externalModelUpdateEvent = findModel.externalEvent; | ||
} | ||
if (Object.keys(options).length > 0) { | ||
templateString += `,\n`; | ||
templateString += JSON.stringify(options, null, 2); | ||
templateString += `'${findModel.targetAttr}', '${findModel.event}', '${findModel.externalEvent}'`; | ||
} | ||
@@ -113,0 +107,0 @@ templateString += `);\n`; |
@@ -11,7 +11,2 @@ export interface OutputTargetVue { | ||
} | ||
export interface ComponentOptions { | ||
modelProp?: string; | ||
modelUpdateEvent?: string | string[]; | ||
externalModelUpdateEvent?: string; | ||
} | ||
export interface ComponentModelConfig { | ||
@@ -18,0 +13,0 @@ elements: string | string[]; |
{ | ||
"name": "@stencil/vue-output-target", | ||
"version": "0.4.2-0", | ||
"version": "0.4.2-1", | ||
"description": "Vue output target for @stencil/core components.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js", |
@@ -17,8 +17,2 @@ import { VNode, defineComponent, getCurrentInstance, h, inject, ref, Ref } from 'vue'; | ||
interface ComponentOptions { | ||
modelProp?: string; | ||
modelUpdateEvent?: string | string[]; | ||
externalModelUpdateEvent?: string; | ||
} | ||
const getComponentClasses = (classes: unknown) => { | ||
@@ -41,7 +35,6 @@ return (classes as string)?.split(' ') || []; | ||
* @prop modelProp - The prop that v-model binds to (i.e. value) | ||
* @prop modelUpdateEvent - The event that is fired when the value changes (i.e. ionChange) | ||
* @prop modelUpdateEvent - The event that is fired when the value changes (i.e. v-ion-change) | ||
* @prop externalModelUpdateEvent - The event that should be fired from the Vue component wrapper (i.e ionChange) | ||
*/ | ||
export const defineContainer = <Props>(name: string, customElement: any, componentProps: string[] = [], componentOptions: ComponentOptions = {}) => { | ||
const { modelProp, modelUpdateEvent, externalModelUpdateEvent } = componentOptions; | ||
export const defineContainer = <Props>(name: string, customElement: any, componentProps: string[] = [], modelProp?: string, modelUpdateEvent?: string, externalModelUpdateEvent?: string) => { | ||
customElements.define(name, customElement); | ||
@@ -48,0 +41,0 @@ |
40391
847