Skip to content

Instantly share code, notes, and snippets.

@TanisukeGoro
Last active December 1, 2019 07:08
Show Gist options
  • Save TanisukeGoro/399c7c20591042dc4308dfa85b103c36 to your computer and use it in GitHub Desktop.
Save TanisukeGoro/399c7c20591042dc4308dfa85b103c36 to your computer and use it in GitHub Desktop.

症状

Githubのissueと同様にeslint(vue/require-component-is)のエラーが表示されます。

環境

node v10.15.3
Nuxt.js v2.10.2

以下のコマンドを入力するとこのように出力されます。

npm list eslint-plugin-vue

~~~@1.0.0
├─┬ @nuxtjs/eslint-config@1.1.2
│ └── eslint-plugin-vue@5.2.3 
└─┬ eslint-plugin-nuxt@0.5.0
  └── eslint-plugin-vue@6.0.1 

該当コード

<template>
  <v-app>
    <v-content class="py-0">
      <!--   以下のようなエラーが出力れます。     -->
      <!--   Expected '<component>' elements to have 'v-bind:is' attribute.eslint(vue/require-component-is)    -->
      <v-container grid-list-xs sclass="original-px-0"> 
        <component :is="componentId" />
      </v-container>
    </v-content>
  </v-app>
</template>

<script>
export default {
  components: {
    sex: () => import('@/components/form/VSex.vue'),
    name: () => import('@/components/form/VFullName.vue')
  },
  data() {
    return {
      componentId: 'sex'
    }
  },
  computed: {
    componentName() {
      return this.componentId
    }
  }
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment