Skip to content

Html HTML内容

type : 'html'

用于展示HTML字符串内容的渲染。

代码演示

基础用法

<template>
    <x-form ref="formRef" label-align="top" :model="formValue" :items="formOptions" />
</template>

<script lang="ts" setup>
import { ref } from 'vue';
const formRef = ref();
const formValue = ref({
    html: '<div style="color: red">这是一个html内容</div>',
});
const formOptions = ref([
    {
        label: 'Html',
        type: 'html',
        name: 'html',
        itemProps: {
            required: true,
        }
    },
]);
</script>
<style lang="scss" scoped></style>
基础用法

API

Props

Events