详细问题描述
(DCloud产品不会有明显的bug,所以你遇到的问题大都是在特定环境下才能重现的问题,请仔细描述你的环境和重现方式,否则DCloud很难排查解决你的问题)
[内容]
<view class="page">
<headStep :step="'step1'" :cardType="22"></headStep>
<view class="conten-body">
<view class="cell top_cell">
<view class="label">选择套餐</view>
<view>
<input disabled :value="good.name ? good.name : ''" placeholder="请选择套餐"></input>
</view>
</view>
</view>
</view>
重现步骤
[步骤]
进行ctrl + k 代码格式化
[结果]
[Format] 08:47:54.216 D:\HBuilderX.1.7.0.20190314.full\HBuilderX\plugins\formator-prettier\node_modules\prettier\index.js:10611
[Format] 08:47:54.216 throw error;
[Format] 08:47:54.216 ^
[Format] 08:47:54.216
[Format] 08:47:54.216 SyntaxError: Void elements do not have end tags "input" (9:78)
[Format] 08:47:54.216 7 | <view class="label">选择套餐</view>
[Format] 08:47:54.216 8 | <view>
[Format] 08:47:54.216 > 9 | <input disabled :value="good.name ? good.name : ''" placeholder="请选择套餐"></input>
[Format] 08:47:54.216 | ^
[Format] 08:47:54.216 10 | </view>
[Format] 08:47:54.217 11 | </view>
[Format] 08:47:54.217 12 |
[Format] 08:47:54.217 at Vt (D:\HBuilderX.1.7.0.20190314.full\HBuilderX\plugins\formator-prettier\node_modules\prettier\parser-html.js:1:22957)
[Format] 08:47:54.217 at gn (D:\HBuilderX.1.7.0.20190314.full\HBuilderX\plugins\formator-prettier\node_modules\prettier\parser-html.js:1:79367)
[Format] 08:47:54.217 at e (D:\HBuilderX.1.7.0.20190314.full\HBuilderX\plugins\formator-prettier\node_modules\prettier\parser-html.js:1:81707)
[Format] 08:47:54.217 at Object.parse (D:\HBuilderX.1.7.0.20190314.full\HBuilderX\plugins\formator-prettier\node_modules\prettier\parser-html.js:1:82558)
[Format] 08:47:54.217 at Object.parse$2 [as parse] (D:\HBuilderX.1.7.0.20190314.full\HBuilderX\plugins\formator-prettier\node_modules\prettier\index.js:10600:19)
[Format] 08:47:54.217 at coreFormat (D:\HBuilderX.1.7.0.20190314.full\HBuilderX\plugins\formator-prettier\node_modules\prettier\index.js:13763:23)
[Format] 08:47:54.217 at format (D:\HBuilderX.1.7.0.20190314.full\HBuilderX\plugins\formator-prettier\node_modules\prettier\index.js:13939:16)
[Format] 08:47:54.217 at formatWithCursor (D:\HBuilderX.1.7.0.20190314.full\HBuilderX\plugins\formator-prettier\node_modules\prettier\index.js:13951:12)
[Format] 08:47:54.217 at D:\HBuilderX.1.7.0.20190314.full\HBuilderX\plugins\formator-prettier\node_modules\prettier\index.js:41967:15
[Format] 08:47:54.217 at Object.format (D:\HBuilderX.1.7.0.20190314.full\HBuilderX\plugins\formator-prettier\node_modules\prettier\index.js:41986:12)
[Format] 08:47:54.217
d***@qq.com
用vscode开发, 在格式化vue文件时 提示Formatting failed: "3:45-3:53: Void elements do not have end tags image
怎么解决?
用的是vetur
2020-04-25 09:00