The subcomponent props receives different types of values

the first two values passed by the parent component can be printed in watch, but not in childExchangeRate. Is it because of the different types? What is the correct writing format?

props: {

childAssets: "",
childBookdata: "",
childExchangeRate: 0

},

Mar.28,2021

try this

  props: {
    childAssets: {
      required: false,
      type: String,
      default: ""
    },
    childBookdata: {
      required: false,
      type: String,
      default: ""
    },
    childExchangeRate: {
      required: false,
      type: Number,
      default: 0
    }
  },

vue props link ide/components-props.html" rel=" nofollow noreferrer "> https://cn.vuejs.org/v2/guide.

Menu