Props 静态属性
<template> <div> <ConpentA title="我是静态props"/> </div> </template> <script> import ConpentA from './components/ConpentA.vue' export default { components:{ ConpentA } } </script><style scoped>
</style> <template> <div> <h1>{{ title }}</h1> </div> </template>
<script> export default{ props:{ title:String, default:'' } } </script> Props 动态属性 <template> <div> <ConpentA :title="message"/> </div> </template> <script> import ConpentA from './components/ConpentA.vue' export default { data(){ return{ message: '1111' } }, components:{ ConpentA } } </script>
<style scoped>
</style> 标签:vue,ConpentA,default,export,父传子,components,属性 From: https://www.cnblogs.com/96net/p/18015657