feat: remove opts if empty
This commit is contained in:
parent
5628e62194
commit
4912cc600b
1 changed files with 1 additions and 0 deletions
|
@ -172,6 +172,7 @@ export async function generateHydrateScript(
|
|||
if (metadata.hydrateArgs !== true) {
|
||||
scriptProps.opts.value = metadata.hydrateArgs;
|
||||
}
|
||||
if (Object.keys(scriptProps.opts).length === 0) delete scriptProps.opts;
|
||||
if (typeof props === 'object' && Object.keys(props).length > 0) {
|
||||
scriptProps['props'] = props;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue