|
@@ -208,8 +208,14 @@ const CompNode = defineComponent({
|
|
|
setup(props) {
|
|
|
const editor = useEditor();
|
|
|
const comp = editor.helper.findComp(props.id);
|
|
|
+ const textTitle = (value: string) => {
|
|
|
+ const reg = /<[^>]+>/gi;
|
|
|
+ const text = value.replace(reg, "");
|
|
|
+ return text.substring(0, 10);
|
|
|
+ };
|
|
|
return () => {
|
|
|
if (!comp) return;
|
|
|
+
|
|
|
const compOpts = editor.controls.compUICtrl.state.components.get(
|
|
|
comp.compKey
|
|
|
);
|
|
@@ -218,11 +224,13 @@ const CompNode = defineComponent({
|
|
|
comp.compKey === "Image"
|
|
|
? comp.value.url
|
|
|
: comp.thumbnail || compOpts?.thumbnail;
|
|
|
+ const title =
|
|
|
+ comp.compKey === "Text" ? textTitle(comp.value) : props.title;
|
|
|
return (
|
|
|
<div class={[nodeStyle, "flex"]}>
|
|
|
<Image src={thumbnail} size={240} />
|
|
|
<span class="flex-1 w-0 whitespace-nowrap overflow-hidden overflow-ellipsis pr-10px">
|
|
|
- {props.title}
|
|
|
+ {title}
|
|
|
</span>
|
|
|
<span class="actions space-x-4px whitespace-nowrap transition">
|
|
|
{actions.map((action, i) =>
|