关于微信小程序 tabar多层嵌套问题
底部就不多说,中间是 wx:if 控制
<view class="nav">
<view class="navitem {{num==1?'active':''}}" data-id="1" bindtap="changenav">
<text>one</text>
</view>
<view class="navitem {{num==2?'active':''}}" data-id="2" bindtap="changenav">
<text>two</text>
</view>
<view class="navitem {{num==3?'active':''}}" data-id="3" bindtap="changenav">
<text>three</text>
</view>
<view class="navitem {{num==4?'active':''}}" data-id="4" bindtap="changenav">
<text>four</text>
</view>
</view>
<view class="con" hover-class="none" hover-stop-propagation="false">
<one wx:if="{{num==1}}"></one>
<two wx:if="{{num==2}}"></two>
<three wx:if="{{num==3}}"></three>
<frou wx:if="{{num==4}}"></frou>
</view>
在index.json 中注册
"component": true,
"usingComponents": {
"one": "./one/one",
"two": "./two/two",
"three": "./three/three",
"frou": "./frou/frou"
}