mirror of https://github.com/halo-dev/halo-admin
fix: the issue that the useSlugify hook may cause the value to be undefined
parent
6244e8b5c0
commit
33a5099b40
|
@ -15,6 +15,9 @@ export default function useSlugify(
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleGenerateSlug = () => {
|
const handleGenerateSlug = () => {
|
||||||
|
if (!source.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
target.value = slugify(source.value, {
|
target.value = slugify(source.value, {
|
||||||
trim: true,
|
trim: true,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue