2***@qq.com
2***@qq.com
  • 发布:2020-07-05 11:52
  • 更新:2020-07-06 11:06
  • 阅读:1702

HbuilderX工具的Vue代码风格,我想要格式化代码后是这样的,该如何写配置文件?

分类:HBuilderX

这个是自定义组件的代码格式

原本是这样的,全部在一行

<work-item v-for="(item,idx) in list" :key="idx" :title="item.name" :company="item.company" :content="item.content" @change="change"></work-item>

我想要这样的,比较清晰

<work-item v-for="(item,idx) in list" :key="idx"   
    :title="item.name"   
    :company="item.company"   
    :content="item.content"   
    @change="change">  
</work-item>

我是在这里设置的:工具 --> 代码块设置 --> vue代码块

在自定义代码块中添加了以下代码,最终结果是无效的,不起作用
(注:下面代码中我添加了\n\t)

{  
    "Vue Component with Props Binding": {  
            "body": [  
                "<${1:component} \n\t:${1:propName}=\"${0}\"></${1:component}>"  
            ],  
            "description": "component element with props",  
            "prefix": "vel-props",  
            "scope": "source.vue.html"  
        }  
}
2020-07-05 11:52 负责人:无 分享
已邀请:
DCloud_HB_WDL

DCloud_HB_WDL

该问题目前已经被锁定, 无法添加新回复