现状(tab)
<view class="img-upload">
<!-- #ifdef MP-WEIXIN -->
<view class="img-choice img-box" @click="chooseImg" v-if="imgList.length < this.limit && !disabled">
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="img-choice img-box" @click="chooseImg" v-show="imgList.length < this.limit && !disabled">
<!-- #endif -->
<uni-icons type="plusempty" size="30"></uni-icons>
</view>
</view>
eslint格式化后会这样 自动补全标签 并且注释缩放不美观
<view class="img-upload">
<!-- #ifdef MP-WEIXIN -->
<view class="img-choice img-box" @click="chooseImg" v-if="imgList.length < this.limit && !disabled">
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="img-choice img-box" @click="chooseImg" v-show="imgList.length < this.limit && !disabled">
<!-- #endif -->
<uni-icons type="plusempty" size="30" />
</view>
</view>
</view>
希望格式化后是这样的
<view class="img-upload">
<!-- #ifdef MP-WEIXIN -->
<view class="img-choice img-box" @click="chooseImg" v-if="imgList.length < this.limit && !disabled">
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="img-choice img-box" @click="chooseImg" v-show="imgList.length < this.limit && !disabled">
<!-- #endif -->
<uni-icons type="plusempty" size="30" />
</view>
</view>
2 个回复
前端卩罙井冰 (作者)
没人遇到过吗???
不如摸鱼去 - 一个前端打工仔。如果我的回答对你产生了帮助,还请给个star: https://github.com/Moonofweisheng
看你贴的代码好像是view标签没有闭合,代码中只有五个view