如图:报个红叉,没注意直接运行,结果没出错。
浏览器 F12 一看,提示这么一段话,说的是 子组件属性传值绑定时名称不能 有 大写,必须小写,此处有点纳闷,但问题解决。
vue-2.4.0.js:471 [Vue tip]: Prop "datamsg" is passed to component <Com1>, but the declared prop name is "dataMsg". Note that HTML attributes are case-insensitive and camelCased props need to use their kebab-case equivalents when using in-DOM templates. You should probably use "data-msg" instead of "dataMsg".