31 lines
690 B
Vue
31 lines
690 B
Vue
<template>
|
|
<div class="demo">
|
|
<t-input
|
|
v-model="maxHeight"
|
|
class="field"
|
|
placeholder="最大高度,如 20rem"
|
|
/>
|
|
<tiptap-view :content="content" :max-height="maxHeight" />
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { ref } from "vue";
|
|
import { TiptapView } from "timi-tdesign-pc";
|
|
|
|
const content = `<h2>只读视图</h2>
|
|
<p>与编辑器共用同一套渲染规则,内容超出 <code>maxHeight</code> 时可滚动查看。</p>
|
|
<blockquote><p>适合详情页、审批流等只需要阅读的场景。</p></blockquote>`;
|
|
|
|
const maxHeight = ref("20rem");
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
.demo {
|
|
.field {
|
|
width: 16rem;
|
|
margin-bottom: 1rem;
|
|
}
|
|
}
|
|
</style>
|