mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-01-09 20:18:12 +00:00
30 lines
634 B
Vue
30 lines
634 B
Vue
<template>
|
|
<input v-if="model" v-model="model[n]" type="hidden" />
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { computed, defineComponent, PropType } from 'vue';
|
|
|
|
import { HiddenConfig } from '../schema';
|
|
import fieldProps from '../utils/fieldProps';
|
|
import { useAddField } from '../utils/useAddField';
|
|
|
|
export default defineComponent({
|
|
name: 'm-fields-hidden',
|
|
});
|
|
</script>
|
|
|
|
<script setup lang="ts">
|
|
const props = defineProps({
|
|
...fieldProps,
|
|
config: {
|
|
type: Object as PropType<HiddenConfig>,
|
|
required: true,
|
|
},
|
|
});
|
|
|
|
const n = computed(() => props.name || props.config.name || '');
|
|
|
|
useAddField(props.prop);
|
|
</script>
|