LoginSignup
6
1

More than 3 years have passed since last update.

vue/require-valid-default-prop のESLint警告の解消方法

Last updated at Posted at 2019-08-06

環境

  • vue 2.6.10
  • eslint 5.16.0
  • ES7

vue/require-valid-default-prop

export default {
  ...
  props: {
    propArray: {
      type: Array,
      default: []
    },
    propObject: {
      type: Object,
      default: {}
    }
  },
  ...
}

上記の様に書くと vue/require-valid-default-prop のESLint警告が出ます。

export default {
  ...
  props: {
    propArray: {
      type: Array,
      default: () => []
    },
    propObject: {
      type: Object,
      default: () => {}
    }
  },
  ...
}

こうすればok

6
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
1