摘要: 1、父组件向子组件传递内容 <div id="app"> <alert-box>警示框</alert-box> <alert-box>有一个警告</alert-box> <alert-box></alert-box> <!-- 没有内容 显示默认内容 --> </div> <script src=" 阅读全文
posted @ 2020-04-08 17:25 Alisa-k 阅读(545) 评论(0) 推荐(0) 编辑
摘要: 1、父组件向子组件传值 组件内部通过props接受传递过来的值 props属性名规则 在props中使用驼峰形式,模板中需要使用短横线的形式 在字符串形式的模板中没有这个限制 <div id="app"> <div>{{pmsg}}</div> <test-con title="来自父组件的值" c 阅读全文
posted @ 2020-04-08 16:26 Alisa-k 阅读(339) 评论(0) 推荐(0) 编辑