Skip to content

Commit 69180cb

Browse files
committed
优化
1 parent 330bf4d commit 69180cb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/plugins/editor-preview/components/preview.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const props = defineProps({
8282
type: String,
8383
default: "60%"
8484
},
85+
formatter: Function,
8586
8687
// 多个内容展示
8788
tabs: Array as PropType<TabItem[]>,
@@ -138,6 +139,10 @@ async function open(data?: string | TabItem[]) {
138139
data = props.modelValue;
139140
}
140141
142+
if (props.formatter) {
143+
data = props.formatter(data);
144+
}
145+
141146
if (props.tabs) {
142147
list.value = props.tabs;
143148
onTabChange(0);

0 commit comments

Comments
 (0)