Skip to content

Reactive does not react vue-i18n #303

@gokhantaskan

Description

@gokhantaskan

I'm using composition API in some components. The code below is not working when the page loads initially.

setup(props, vm) {
  const state = reactive({
    routes: [
      {
        name: vm.root.$i18n.t("titles.overview"),
        icon: "overview",
        path: { name: "Overview" },
        isFor: ["retailer", "consumer"]
      },
      ...
  return { ...toRefs(state) };
}

vue-i18n.esm.js?a925:33 [vue-i18n] Cannot translate the value of keypath 'labels.settings'. Use the value of keypath as default.

But there is nothing wrong. In another component, it is working.

<page-heading
    :title="$t('titles.overview')"
    has-datepicker
    show-date
>
</page-heading>

image

After changing something that causes hot reload (like console.log("x") just before const state, the sidebar shows the title normally but when the initial load, the text is just titles.blabla.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions