代码如下,请问如何通过点击van-sidebar-item项改变{{activeKey}}的值,实现box_1的内容显示与隐藏。
<view class="side">
<van-sidebar active-key="{{ activeKey }}" bind:change="onChange">
<van-sidebar-item title="标签名 1" />
<van-sidebar-item title="标签名 2" />
<van-sidebar-item title="标签名 3" />
</van-sidebar>
<van-notify id="van-notify" />
</view>
<view class="box_1" wx:if="{{activeKey == 0}}">11</view>
<view class="box_1" wx:elif="{{activeKey == 1}}">22</view>
data{
activeKey: 0,
},
onChange(event) {
Notify({ type: 'primary', message: event.detail });
},
点击切换后的打印