步骤一:打开工具——代码块设置——vue代码块
步骤二:在右边自定义代码块写自己要的结构
步骤三:写下自己要用的代码结构「 \t:缩进一个就是一个单元符;prefix:输入这个就能出现代码块 因为是uniapp所以其他不用修改也可以」
"uniTab":{
"body":[
"<view class=\"uni-tab-bar\">",
"\t<scroll-view scroll-x class=\"uni-swiper-tab\">",
"\t\t<block v-for=\"(tab,index) in tabBars\" :key=\"tab.id\">",
"\t\t\t<view class=\"swiper-tab-list\" :class=\"{'active':tabIndex==index}\" @click=\"tabtap(index)\">",
"\t\t\t\t{{tab.name}}",
"\t\t\t</view>",
"\t\t</block>",
"\t</scroll-view>",
"</view>"
],
"prefix": "uniTab",
"project": "uni-app",
"scope": "source.vue.html"
}
效果图: