Last active
March 13, 2017 16:32
-
-
Save mogocat/a6ea8a1811b21953c5b2b79a732a4a06 to your computer and use it in GitHub Desktop.
[VUE父子Props]#tag:vue,props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template lang="html"> | |
</template> | |
<script> | |
// 用camel命名法去接收肉串命名法的变量 | |
export default { | |
props: ['accessoryForm'] | |
} | |
</script> | |
<style lang="css"> | |
.top{ | |
margin-top: 20px; | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template lang="html"> | |
<child :accessory-form="accessoryForm"> | |
</child> | |
</template> | |
<script> | |
// camel命名法必须用肉串命名法接收 | |
import Child from './child' | |
export default { | |
data(){ | |
return{ | |
accessoryForm: {xxx: yyy} | |
} | |
} | |
components: { | |
Child | |
} | |
} | |
</script> | |
<style lang="css"> | |
.top{ | |
margin-top: 20px; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment