1
0
mirror of synced 2024-11-22 05:16:05 +03:00

Merge pull request #34 from cmath10/formulario-field-html-tag

feat: Possibility to change html tag used by FormularioField
This commit is contained in:
Kruglov Kirill 2021-09-29 11:37:49 +03:00 committed by GitHub
commit 5d9991e880
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,10 @@
<template> <template>
<div v-bind="$attrs"> <component
:is="tag"
v-bind="$attrs"
>
<slot :context="context" /> <slot :context="context" />
</div> </component>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -68,6 +71,8 @@ export default class FormularioField extends Vue {
@Prop({ default: () => <U, T>(value: U|Empty): U|T|Empty => value }) modelGetConverter!: ModelGetConverter @Prop({ default: () => <U, T>(value: U|Empty): U|T|Empty => value }) modelGetConverter!: ModelGetConverter
@Prop({ default: () => <T, U>(value: U|T): U|T => value }) modelSetConverter!: ModelSetConverter @Prop({ default: () => <T, U>(value: U|T): U|T => value }) modelSetConverter!: ModelSetConverter
@Prop({ default: 'div' }) tag!: string
public proxy: unknown = this.hasModel ? this.value : '' public proxy: unknown = this.hasModel ? this.value : ''
private localErrors: string[] = [] private localErrors: string[] = []