<template wx:if="QuanXian_WenZhang_FaBu === true">
<view class="FaXian-Nav-For" @click="DJ_FaBu_WenZhang">
<text class="iconfont icon-yingpingmoban"></text>
<view>发布文章</view>
</view>
</template>
<template v-else>
<view class="FaXian-Nav-For" @click="DJ_WuQuanXian">
<text class="iconfont icon-shibai" style="background: #999;"></text>
<view>发布文章</view>
</view>
</template>
- 发布:2020-12-07 18:26
- 更新:2020-12-07 20:40
- 阅读:454
产品分类: uniapp/小程序/微信
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 2.9.11
第三方开发者工具版本号: 1.0.0
基础库版本号: 1.0.0
项目创建方式: HBuilderX
示例代码:
操作步骤:
<template wx:if="QuanXian_WenZhang_FaBu === true">
<view class="FaXian-Nav-For" @click="DJ_FaBu_WenZhang">
<text class="iconfont icon-yingpingmoban"></text>
<view>发布文章</view>
</view>
</template>
<template v-else>
<view class="FaXian-Nav-For" @click="DJ_WuQuanXian">
<text class="iconfont icon-shibai" style="background: #999;"></text>
<view>发布文章</view>
</view>
</template>
<template wx:if="QuanXian_WenZhang_FaBu === true">
<view class="FaXian-Nav-For" @click="DJ_FaBu_WenZhang">
<text class="iconfont icon-yingpingmoban"></text>
<view>发布文章</view>
</view>
</template>
<template v-else>
<view class="FaXian-Nav-For" @click="DJ_WuQuanXian">
<text class="iconfont icon-shibai" style="background: #999;"></text>
<view>发布文章</view>
</view>
</template>
预期结果:
<template wx:if="QuanXian_WenZhang_FaBu === true">
<view class="FaXian-Nav-For" @click="DJ_FaBu_WenZhang">
<text class="iconfont icon-yingpingmoban"></text>
<view>发布文章</view>
</view>
</template>
<template v-else>
<view class="FaXian-Nav-For" @click="DJ_WuQuanXian">
<text class="iconfont icon-shibai" style="background: #999;"></text>
<view>发布文章</view>
</view>
</template>
<template wx:if="QuanXian_WenZhang_FaBu === true">
<view class="FaXian-Nav-For" @click="DJ_FaBu_WenZhang">
<text class="iconfont icon-yingpingmoban"></text>
<view>发布文章</view>
</view>
</template>
<template v-else>
<view class="FaXian-Nav-For" @click="DJ_WuQuanXian">
<text class="iconfont icon-shibai" style="background: #999;"></text>
<view>发布文章</view>
</view>
</template>
实际结果:
<template wx:if="QuanXian_WenZhang_FaBu === true">
<view class="FaXian-Nav-For" @click="DJ_FaBu_WenZhang">
<text class="iconfont icon-yingpingmoban"></text>
<view>发布文章</view>
</view>
</template>
<template v-else>
<view class="FaXian-Nav-For" @click="DJ_WuQuanXian">
<text class="iconfont icon-shibai" style="background: #999;"></text>
<view>发布文章</view>
</view>
</template>
<template wx:if="QuanXian_WenZhang_FaBu === true">
<view class="FaXian-Nav-For" @click="DJ_FaBu_WenZhang">
<text class="iconfont icon-yingpingmoban"></text>
<view>发布文章</view>
</view>
</template>
<template v-else>
<view class="FaXian-Nav-For" @click="DJ_WuQuanXian">
<text class="iconfont icon-shibai" style="background: #999;"></text>
<view>发布文章</view>
</view>
</template>
bug描述:
v-if,在小程序竟然不生效。。。改成wx:if就可以。。。然后,最搞笑的是,v-else竟然生效,改成wx:else竟然不生效。。卧槽。。。。。。。。。。。。。。。。。