划重点
鱼香肉丝 一小份
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="./lib/vue-2.6.10.js"></script>
<script src="./lib/vue-router.js"></script>
</head>
<body>
<div id="app">
<com1 :fathermsg="msg"></com1>
</div>
<template id="divtem1">
<div>
<h1>{{ fathermsg }}111</h1>
</div>
</template>
<script>
var tem1 = {
template: '#divtem1',
props: ['fathermsg']
}
var vm = new Vue({
el: '#app',
data: {
msg: '父组件向子组件传值'
},
methods: {},
components: {
com1: tem1
},
})
</script>
</body>
</html>