父组件.wxml
<Select prop-array='{
{selectArray}}' bind:myget='getDate'></Select>
父组件.json
{
"usingComponents": {
"Select": "../select/select"
}
}
父组件.js
//select
getDate: function (e) {
console.log(e.detail)//子组件传过来的参数
this.setData({
name:e.detail.text,
id:e.detail.id
})
}
子组件.wxml
<view class="com-selectBox">
<view class="com-sContent" bindtap="selectToggle">
<view class='com-sTxt'>{
{nowText}}</view>
<!-- 右侧箭头-动画效果 -->
<!-- <image src='../../public/image/index/jinru1@2x.png' class='com-sImg' animation="{
{animationDat