Skip to content

Instantly share code, notes, and snippets.

@chenillen
Created March 19, 2018 13:25
Show Gist options
  • Save chenillen/f5f2e0b9474a79391f3d28fa460e67fa to your computer and use it in GitHub Desktop.
Save chenillen/f5f2e0b9474a79391f3d28fa460e67fa to your computer and use it in GitHub Desktop.
Wepy
<script>
import wepy from 'wepy'
export default class Child1 extends wepy.page {
props = {
childId: {
type: String,
default: null
}
}
onLoad() {
console.log(this.childId)
}
}
</script>
<template>
</template>
<script>
import wepy from 'wepy'
export default class Child2 extends wepy.page {
props = {
childId: {
type: String,
default: null
}
}
onLoad() {
console.log(this.childId)
}
}
</script>
<template>
</template>
<script>
import wepy from 'wepy'
export default class Parent extends wepy.page {
data = {
parentId: '2131231231'
}
}
</script>
<template>
<child1 :childId.sync="parentId" />
<child2 :childId.sync="parentId" />
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment