Question · Vue.js course · Module 7: Props & Events

Required prop

How do you mark a prop as required?

Answer options

  • { message: { type: String, required: true } }
  • { message: String! }
  • { message: required(String) }
  • You cannot mark it as required

You can check the correct answer by solving this task in the CodeWorlds game.