1、child.wxml
<!-- name="child1"在父组件中调用 -->
<template name="child1">
<view>{{child1Data}}</view>
</template>
2、parent.wxml
<import src="transferTemplate1.wxml" />
<!-- 通过is="child1" 子组件的名字来展示 -->
<template is="child1" data="{{childData: sendChildData}}" />
3、 parant.js
Component({
properties: {
},
data: {
sendChildData:'我是父组件给的子组件值'
},
methods: {
}
})