refactor: page.text.vue to use composition api #25

Manually merged
Johann150 merged 4 commits from :refactor/page.text.vue into main 2022-07-25 05:52:33 +00:00
Owner
No description provided.
norm added 1 commit 2022-07-23 21:42:18 +00:00
refactor: page.text.vue to use composition api
Some checks failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
d79fe1dee0
norm added 1 commit 2022-07-23 21:51:58 +00:00
Add padding
Some checks failed
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
d6a5eb4666
This will let not have text right up against the edge.
norm added 1 commit 2022-07-23 21:57:07 +00:00
only add padding for left and right sides
Some checks failed
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
ebfe2162e9
Johann150 reviewed 2022-07-24 09:38:07 +00:00
@ -51,0 +19,4 @@
const MkUrlPreview = defineAsyncComponent(() => import('@/components/url-preview.vue'));
let text: string = $ref(props.hpml.interpolate(props.block.text) ?? '');
Owner

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).

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).
norm marked this conversation as resolved
@ -51,0 +30,4 @@
});
watch(props.hpml.vars, () => {
text = props.hpml.interpolate(props.block.text) ?? '';
Owner

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 in null, which isnt allowed by the TextBlock type.

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 in `null`, which isnt allowed by the `TextBlock` type.
norm marked this conversation as resolved
norm added 1 commit 2022-07-24 15:58:24 +00:00
use immediate: true for watch
Some checks failed
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
6ffbabeedc
Johann150 manually merged commit 6d3181f983 into main 2022-07-25 05:52:33 +00:00
norm deleted branch refactor/page.text.vue 2022-07-27 21:21:10 +00:00
Sign in to join this conversation.
No reviewers
No labels
feature
fix
upkeep
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: FoundKeyGang/FoundKey#25
No description provided.