Understanding props in vue.js

前端 未结 3 445
梦毁少年i
梦毁少年i 2021-02-07 07:48

I\'m working through the guide for learning vue.js, got to the section on props, and ran into a question.

I understand that child components have isolated scops and we

3条回答
  •  情话喂你
    2021-02-07 08:20

    You can also pass any string to "greeting" by just setting it like normal html attribute, without using v-bind directive.

    
    

    Will also work. Note that anything you pass that way will be interpreted as plain string.

    
    

    Will result in "2 + 2, Chris".
    More in user guide: https://vuejs.org/v2/guide/components.html#Props

提交回复
热议问题