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

pull/884/head
Ryan Wang 2023-02-24 14:16:25 +08:00
parent 6244e8b5c0
commit 33a5099b40
1 changed files with 3 additions and 0 deletions

View File

@ -15,6 +15,9 @@ export default function useSlugify(
);
const handleGenerateSlug = () => {
if (!source.value) {
return;
}
target.value = slugify(source.value, {
trim: true,
});