import { h } from 'vue';
import { QuestionCircleOutlined } from '@ant-design/icons-vue';
/**
* 创建带有可选Tooltip的表单标签
* @param label 标签文本
* @param tips Tooltip提示内容,如果不提供则不显示Tooltip
* @returns 渲染函数
*/
const renderLabelWithTooltip = (label: string, tips?: string) => {
// 如果没有提供tips,则只渲染标签文本
if (!tips) {
return () => h('span', {}, label);
}
// 如果提供了tips,则渲染带有Tooltip的标签
return () => h('div', { style: { display: 'flex', alignItems: 'center' } }, [
h('span', {}, label),
h('a表单label处理
import { h } from 'vue'; import { QuestionCircleOutlined } from '@ant-design/icons-vue'; /** * 创建带有可选Tooltip的表单标签 * @param label 标签文本 * @param tips