mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-28 19:00:35 +01:00
docs(ComponentCode): fix edge-case
This commit is contained in:
@@ -211,7 +211,7 @@ ${props.slots?.default}
|
|||||||
`
|
`
|
||||||
for (const key of props.external) {
|
for (const key of props.external) {
|
||||||
const cast = props.cast?.[key]
|
const cast = props.cast?.[key]
|
||||||
const value = cast ? castMap[cast]!.template(componentProps[key]) : json5.stringify(componentProps[key], null, 2).replace(/,([ |\t\n]+[}|\]])/g, '$1')
|
const value = cast ? castMap[cast]!.template(componentProps[key]) : json5.stringify(componentProps[key], null, 2)?.replace(/,([ |\t\n]+[}|\]])/g, '$1')
|
||||||
|
|
||||||
code += `const ${key === 'modelValue' ? 'value' : key} = ref(${value})
|
code += `const ${key === 'modelValue' ? 'value' : key} = ref(${value})
|
||||||
`
|
`
|
||||||
|
|||||||
Reference in New Issue
Block a user