peakchen90 / vue-beautify Goto Github PK
View Code? Open in Web Editor NEWvscode的一个vue格式化插件
Home Page: https://marketplace.visualstudio.com/items?itemName=peakchen90.vue-beautify
vscode的一个vue格式化插件
Home Page: https://marketplace.visualstudio.com/items?itemName=peakchen90.vue-beautify
测试代码:
<template>
<div class="page-quick-link">
<div class="page-quick-link-main">
<button class="quick-link-feedback">
<div class="icon-service"></div>
<span>客服</span>
<QuickResponseCode/>
</button>
<button
class="quick-link-top"
:class="{'quick-link-top-hidden': !showTop, 'quick-link-top-show': showTop}"
@click="scrollToTop()">
<span class="quick-link-top-text">回到<br/>顶部</span>
<icon
class="quick-link-top-arrow"
name="arrow-right"></icon>
</button>
</div>
</div>
</template>
格式化后代码:
<template>
<div class="page-quick-link">
<div class="page-quick-link-main">
<button class="quick-link-feedback">
<div class="icon-service"></div>
<span>客服</span>
<QuickResponseCode/>
</button>
<button class="quick-link-top" :class="{'quick-link-top-hidden': !showTop, 'quick-link-top-show': showTop}" @click="scrollToTop()">
<span class="quick-link-top-text">回到<br/>顶部</span>
<icon
class="quick-link-top-arrow"
name="arrow-right"></icon>
</button>
</div>
</div>
</template>
vscode version: 版本 1.26.1 (1.26.1)
vue-beautify: 最新版本
系统: macos
如题. 需要配置什么吗, 谢谢!
跟editconfig這個插件有衝突,請看這個帖子,他會導致editconfig的一些行為異常
Steps to reproduce:
<template>
<template class="buggy"></template>
</template>
Expected:
<template>
<template class="buggy"></template>
</template>
Actual:
<template>
<template class="buggy">
</template>
</template>
RT
Pressing Ctrl+Shift+F
, VSCode shows up the message command 'vueBeautify.format' not found
mac/windows 都提示插件存在bug,但是mac上使用基本正常,但是Windows上,就是各种问题,很多空白行,缩进也不对
将editor.action.formatDocument和vueBeautify.format都设置同一个快捷键之后,在非vue的文件里面,原来的formatDocument不起作用了
I'd suggest removing the default keyboard shortcut, or at least put it on something unused. Ctrl + Shift + F is the MacOS shortcut for global search, took me a minute to find out why my search wasn't working anymore :))
Thank you for your work!
Beautify vue command inserts an empty newline after elements
Now the formatting style is not javascript standard.
如题。
使用后出现如下的情况
<script>
function handle(){
var a = 1;
var b =2;
console.log(a + b);
}
</script>
<el-table :data="optList" stripe style="width: 80%">
<el-table-column prop="deviceCode" label="设备ID" min-width="100"></el-table-column>
<el-table-column prop="addtime" label="用户ID" min-width="150"></el-table-column>
<el-table-column prop="productName" label="所属产品" min-width="180"></el-table-column>
<el-table-column prop="opt" label="操作" min-width="80"></el-table-column>
</el-table>
格式化后每行都给插入空行,怎么去掉
<el-table :data="optList" stripe style="width: 80%">
<el-table-column prop="deviceCode" label="设备ID" min-width="100"></el-table-column>
<el-table-column prop="addtime" label="用户ID" min-width="150"></el-table-column>
<el-table-column prop="productName" label="所属产品" min-width="180"></el-table-column>
<el-table-column prop="opt" label="操作" min-width="80"></el-table-column>
</el-table>
可否添加函数名称与括号之间增加空格功能
Greetings, what theme are you using in your editor for the screenshot gif ?
<script>
import {
Meteor
} from 'meteor/meteor';
export default {
data() {
比如,像这种 import { mapState, mapActions, mapMutations } from 'vuex'
格式化后就变成
import {
mapState,
mapActions,
mapMutations
} from 'vuex'
并不想把这种的格式化掉。。。
现在的pug/jade格式化出来一团糟。
非常需要支持
在template中嵌套另一个template,无法自动配对template,所有闭合标签都与第一个对其
Activating extension 'peakchen90.vue-beautify' failed: vscode.window.showWarningMessage is not a constructor.
_logMessageInConsole @ extensionService.ts:790
_logOrShowMessage @ extensionService.ts:804
(anonymous) @ mainThreadExtensionService.ts:67
(anonymous) @ errors.ts:184
n @ errors.ts:184
$onExtensionActivationError @ mainThreadExtensionService.ts:65
_doInvokeHandler @ rpcProtocol.ts:390
_invokeHandler @ rpcProtocol.ts:375
_receiveRequest @ rpcProtocol.ts:295
_receiveOneMessage @ rpcProtocol.ts:225
_protocol.onMessage.e @ rpcProtocol.ts:100
fire @ event.ts:584
r @ ipc.net.ts:332
e @ ipc.net.ts:339
fire @ event.ts:584
e @ ipc.net.ts:157
_socketDataListener.e @ ipc.net.ts:171
emit @ events.js:182
addChunk @ _stream_readable.js:279
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onread @ net.js:636
[Extension Host] Here is the error stack: TypeError: vscode.window.showWarningMessage is not a constructor
at activate (c:\Users\Meher.vscode-insiders\extensions\peakchen90.vue-beautify-2.0.4\extension.js:15:5)
at Function._callActivateOptional (c:\Users\Meher\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:701:21)
at Function._callActivate (c:\Users\Meher\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:700:704)
at define._doActivateExtension.Promise.all.then.e (c:\Users\Meher\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:699:895) (at define._activateExtension.s._host.actualActivateExtension.then.t (c:\Users\Meher\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:442:921))
可选链操作符和空值合并操作符的问题 (?. ??) 会被分开报错
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.