就眠儀式 f030784410 🐛(layer): typescript 错误
更新文档
2022-06-18 15:57:10 +08:00

27 lines
470 B
Vue

<script lang="ts">
export default {
name: "Title",
};
</script>
<script lang="ts" setup>
export interface HeaderProps {
title: string | boolean | Function;
}
const renderContent = function (content: any) {
if (typeof content === "function") {
return content();
}
return content;
};
const props = defineProps<HeaderProps>();
</script>
<template>
<div class="layui-layer-title" style="cursor: move">
{{ renderContent(title) }}
</div>
</template>