Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

fix: the issue that the useSlugify hook may cause the value to be undefined #884

Merged
merged 2 commits into from
Feb 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/composables/use-slugify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export default function useSlugify(
);

const handleGenerateSlug = () => {
if (!source.value) {
return;
}
target.value = slugify(source.value, {
trim: true,
});
Expand Down