Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.
This repository was archived by the owner on Oct 1, 2025. It is now read-only.

Merging meta from mixins doesn't work anymore #695

@Kapcash

Description

@Kapcash

Description of the problem

I'm working on a Nuxt app and I just found out using head() from a mixins doesn't merge if the component using the mixin also declares a head().

-> Mixin and component meta function doesn't merge properly

Reproduction

Usable Codesandbox
Both index and about pages use the same mixins SeoMixin which declares the meta title and a canonical link.

  • The index page doesn't have its own head method, so it has the meta info from the mixin as expected. (tab title is "Title from mixin")
  • The about page has its own head method, and it doesn't merge with the mixin results (see the tab title)

Steps to reproduce

  • Create a Vue mixins that declare a meta function (head, metaInfo or whatever depending on the configuration)
  • Create a component that uses the mixin and declare its own meta function
  • Both results from mixin + component are not merged

Notes

There were a similar issues before, which has been fixed by PR #262
But it looks like the last releases has introduced a regression for this.

I started adding a unit test on the code source to check it wasn't working.
I'll try to fix it myself as soon as I have time for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions