Skip to content

Instantly share code, notes, and snippets.

@mogocat
Last active March 13, 2017 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mogocat/a6ea8a1811b21953c5b2b79a732a4a06 to your computer and use it in GitHub Desktop.
Save mogocat/a6ea8a1811b21953c5b2b79a732a4a06 to your computer and use it in GitHub Desktop.
[VUE父子Props]#tag:vue,props
<template lang="html">
</template>
<script>
// 用camel命名法去接收肉串命名法的变量
export default {
props: ['accessoryForm']
}
</script>
<style lang="css">
.top{
margin-top: 20px;
}
</style>
<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