标签:app eth ack nts back data turn 组件 com
parent.vue 父
<template> <div class="wapper"> <child message="hello!"></child> </div> </template> <script> import child from ‘../components/child‘ export default { name:‘wapper‘, components:{child} } </script>
child.vue 子
<template> <div @click="up">点我</div> </template> <script> export default{ data(){ return { msg: ‘请输入值‘ } }, props:[‘message‘], methods: { up() { console.log(this.message) } } } </script>
结果:
hello
标签:app eth ack nts back data turn 组件 com
原文地址:http://www.cnblogs.com/queenw/p/7182306.html