您的位置:首页 > 娱乐 > 八卦 > 郑州网络推广专业公司_erp软件有哪些品牌_长沙电商优化_百度热搜榜排名昨日

郑州网络推广专业公司_erp软件有哪些品牌_长沙电商优化_百度热搜榜排名昨日

2025/5/3 23:59:34 来源:https://blog.csdn.net/THY0827/article/details/147588940  浏览:    关键词:郑州网络推广专业公司_erp软件有哪些品牌_长沙电商优化_百度热搜榜排名昨日
郑州网络推广专业公司_erp软件有哪些品牌_长沙电商优化_百度热搜榜排名昨日

1.打包apk要严格注意一点,在data中定义的时候要把第二层定义上,

    pointspower: [{
                        jcdbh: '1',
                        cgqbhs:[]

}]    

不然会出现未定义的情况,直接把二层结构定义上,有利无害

2.渲染的时候要注意为空的情况

要使用v-if来判断,这个时候涉及到一个v-if,v-for同时使用的问题(有兴趣去看我之前文章,说过这个问题)

在v-for之前使用v-if判断非空

3.v-for="(sensor, sensorIndex) in item.cgqbhs || []"遍历的时候加 ||[]

4.之前听说强制刷新,有人的问题可以解决,目前强制刷新不能解决我的问题,其他场景可以尝试

<view class="table-container">
                    <table width="100%">
                        <thead>
                            <tr>
                                <th class="col-25">测点编号</th>
                                <th class="col-25">传感器编号</th>
                                <th class="col-50">传感器值</th>
                            </tr>
                        </thead>
                        <tbody>
                            
                            <template v-for="(item, index) in pointspower">
                                 <template v-if="item.cgqbhs && item.cgqbhs.length > 0">
                                <tr v-for="(sensor, sensorIndex) in item.cgqbhs || []"
                                    :class="{ 'last-item': isLastItem(index, sensorIndex) }">
                                    
                                    <td v-if='sensorIndex === 0' :colspan="item.cgqbhs.length"
                                        class="center-cell cell ">
                                        {{ item.jcdbh }}
                                    </td>
                                    <td v-else :colspan="item.cgqbhs.length" class="center-cell ">

                                    </td>
                                    <td class=" col-25">{{ sensor.cgqbh_dictText }}</td>
                                    <td class="cell  col-50">
                                        <input :value="sensor.pl" type="number" placeholder="输入观测值"
                                            @input="handleInputs($event, index, sensorIndex)"
                                            @blur="updateValues(index, sensorIndex)" />
                                    </td>
                                </tr>
                            </template>
                            </template>
                        </tbody>
                    </table>
                    
                </view>

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com