refactor: page.text.vue to use composition api #25
Loading…
Reference in a new issue
No description provided.
Delete branch ":refactor/page.text.vue"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -51,0 +19,4 @@
const MkUrlPreview = defineAsyncComponent(() => import('@/components/url-preview.vue'));
let text: string = $ref(props.hpml.interpolate(props.block.text) ?? '');
To reduce code duplication maybe its better to make an empty string ref here and add
immediate: true
to the watch options (after line 35).@ -51,0 +30,4 @@
});
watch(props.hpml.vars, () => {
text = props.hpml.interpolate(props.block.text) ?? '';
What was the reason to add
?? ''
here? The only way I see that that function could return something that is not a string is when you pass innull
, which isnt allowed by theTextBlock
type.