我想将index页面进行传值给wallpaper页面,但是传过去后,wallpaper页面原本的代码却失效了
<!-index.wxml-->
<view class="content">
<wallpaper a="setdata"></wallpaper>
</view>
<!--wallpaper.wxml->
<view class="box" wx:for="{{info}}" wx:key="index">
<image src='{{item.pic}}'></image>
</view>
<view>
<text>111</text>
<text>{{a}}</text>
</view>
//wallpaper.js
Component({
properties: {
a: {
type: String,
value: "index默认值"
}
}
})
在wallpaper.js中有properties时的效果
去除wallpaper.js中的properties时的效果
求解:
懂了,我解决了,虽然花了好多时间去想,我是ascii(83,66)