Vue里的v-if没有生效,大家帮忙看看什么原因?

` <view class="uni-flex material-bottom">

    <text class="flexText material-left">事故发生时出险人是否因公外出:</text>
    <radio-group class="radioGroup" @change="radioChange($event,items,'isGoOut')">
        <label>
            <radio value="T" :checked="items.isGoOut == 'T'"/>
            <text>是</text>
        </label>
        <label>
            <radio value="F" :checked="items.isGoOut == 'F'"/>
            <text>否</text>
        </label>
        <label>
            <radio value="Z" :checked="items.isGoOut == 'Z'"/>
            <text>不清楚</text>
        </label>
    </radio-group>
</view>
<view class="uni-flex material-bottom" v-if="items.isGoOut === 'T'">
    <text class="flexText material-left">外出原因:</text>
    <textarea class="textareaClass" v-model="items.goOutReason" cols="30" rows="10" placeholder="点击输入外出原因"></textarea>
</view>
<view class="uni-flex material-bottom" v-if="items.isGoOut === 'T'">
    <text class="flexText material-left">出险人目的地:</text>
    <input class="flexInput" type="text" v-model="items.destination" placeholder="点击输入出险人目的地">
</view>
<view class="uni-flex material-bottom" v-if="items.isGoOut === 'T'">
    <text class="flexText material-left">车辆所有人:</text>
    <input class="flexInput" type="text" v-model="items.ownerName" placeholder="点击输入车辆所有人">
</view>
<view class="uni-flex material-bottom" v-if="items.isGoOut === 'T'">
    <text class="flexText material-left">汽车保险所属保险公司:</text>
    <input class="flexInput" type="text" v-model="items.insuranceCompany" placeholder="点击输入所属保险公司">
</view>

</view>
`

这段代码我希望单选框选择T的时候下面四个输入框会被显示,选择其他隐藏掉

阅读 4k
2 个回答

少侠你的isGoOut没有双向绑定,选中的时候其值不会改变的。

items.isGoOut的值更新成功了吗

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题