Skip to content

<UserModal> を開いたときに <NavigationSelector> でややCLSが起きる #4882

@cp-20

Description

@cp-20

原因はここで、コンポーネントを遅延ロードしているせい

const getComponent = async (name: string) => {
const moduleFunc = iconModules[`/src/assets/icons/${name}.svg`]
if (!moduleFunc) {
throw new Error(`存在しないアイコン名: ${name}`)
}
const module = await moduleFunc()
return module.default
}
const svgComponent = shallowRef()
watch(
() => props.name,
async () => {
if (props.mdi) return
const name = props.name
const com = await getComponent(name)
if (props.name !== name) return // 取得中にnameが変わったら何もしない
svgComponent.value = com
},
{ immediate: true }
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions