GithubHelp home page GithubHelp logo

oysun / vscode-vuehelper Goto Github PK

View Code? Open in Web Editor NEW
357.0 12.0 35.0 4.15 MB

:monkey_face:vscode插件,vue,vue-router和vuex的代码提示

Home Page: https://marketplace.visualstudio.com/items?itemName=oysun.vuehelper

JavaScript 100.00%
snippets vscode vuejs editor

vscode-vuehelper's Introduction

VueHelper

logo

Notes

  • 版本更新详情请浏览releases
  • 关于文件配置问题,请务必看这里:#1

feature

  • (1) may be the best vue code snippets plug-ins in Vscode, not only includes the vue2 all api, also contains vue-router 2 and vuex 2 code

  • (2) Each snippet has a detailed description, mainly to facilitate learning, because when learning to forget the use of an api, often to consult the document will be a waste of time, so I will increase the description of each code snippet, description of the basis are derived from official documents

snippets

  • The code standard style base on JavaScript Standard Style

  • In vue and vue-router, vuex general $ are the beginning of the vm api,In the vscode code snippet prepared by the $ is a variable, when you enter $ is no role。So for all "$" please enter vm

$

  • Tips for the way Many plug-ins is to use shorthand,for example, the router object method, enter rtb-> will prompt router.beforeEach(),This is convenient, but need to force you to remember, not friendly.So what I've taken is that when you type router, it lists all the properties and methods of the router object

snippets

Vue code snippets

vue

vue-router code snippets

vue-router

vuex code snippets

vuex

Installation

ext install VueHelper

Contributing

This is an open source project open to anyone. Contributions are extremely welcome :github

Release Notes

More versions of the information, please click here

vscode-vuehelper's People

Contributors

oysun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-vuehelper's Issues

inline style problem

<template>
   <div>
      <p style="padding-left: 10px;">aaa</p>
   </div>
</template>

类似这样的内联样式,在 vue 模式下会格式混乱,在 html 模式下不会。但在 html 模式下不识别 scss 代码!

Vue文件中报错

...mapGetters这行报错,
'Property assignment expected.'

怎样能去掉这个报错提示?

配置问题

在vscode安装之后没有任何效果,还要在哪个地方配置一下吗

关于自动生成的代码的格式问题

建议生成的代码格式符合通用的代码规范. JavaScript Standard Style 或者 airbnb javascript style

比如:

"computed": {
  "prefix": "computed",
  "body": [
     "computed:{\n\t$0\n}"
   ],
   "description": "Computed properties to be mixed into the Vue instance. All getters and setters have their this context automatically bound to the Vue instance."
    }

建议在 ":" 和 "{" 之间加一个空格

"computed": {
  "prefix": "computed",
  "body": [
     "computed: {\n\t$0\n}" // ==> 冒号后面加了一个空格
   ],
   "description": "Computed properties to be mixed into the Vue instance. All getters and setters have their this context automatically bound to the Vue instance."
    }

您好,请问这个插件还有人在维护吗?

我想请教一下如何修改提示优先级?我的ts语法类型定义的提示往往会被vueHelper的一些无关提示给挤占到下面去,导致开发变得更麻烦了,修改vscode的snippet为top并不能解决问题
image
image
image

十分感谢您的插件,期待您的回复

script标签里面不出提示

目前发现在.vue文件里面的script标签,输入代码,不出现提示,除了script标签以外,其他地方都可以提示

希望支持Emmet语法

QAQ VScode似乎已经原生支持HTML文件中使用Emmet语法,用习惯后在.vue下无法使用,很是难受

The Vue Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted.

what happen?
Is there anyone else have the same problem?

`
/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10566
throw new Error("start < 0");
^

Error: start < 0
at createTextSpan (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10566:19)
at Object.createTextSpanFromBounds (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10575:16)
at getErrorSpanForNode (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:7075:19)
at createDiagnosticForNodeInSourceFile (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:6999:20)
at Object.createDiagnosticForNode (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:6995:16)
at /Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21582:58
at Object.forEach (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:1423:30)
at declareSymbol (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21581:28)
at declareModuleMember (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21600:28)
at declareSourceFileMember (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:22646:19)
[Info - 1:51:00 AM] Connection to server got closed. Server will restart.
/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10566
throw new Error("start < 0");
^

Error: start < 0
at createTextSpan (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10566:19)
at Object.createTextSpanFromBounds (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10575:16)
at getErrorSpanForNode (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:7075:19)
at createDiagnosticForNodeInSourceFile (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:6999:20)
at Object.createDiagnosticForNode (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:6995:16)
at /Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21582:58
at Object.forEach (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:1423:30)
at declareSymbol (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21581:28)
at declareModuleMember (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21600:28)
at declareSourceFileMember (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:22646:19)
[Info - 1:51:02 AM] Connection to server got closed. Server will restart.
/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10566
throw new Error("start < 0");
^

Error: start < 0
at createTextSpan (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10566:19)
at Object.createTextSpanFromBounds (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10575:16)
at getErrorSpanForNode (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:7075:19)
at createDiagnosticForNodeInSourceFile (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:6999:20)
at Object.createDiagnosticForNode (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:6995:16)
at /Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21582:58
at Object.forEach (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:1423:30)
at declareSymbol (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21581:28)
at declareModuleMember (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21600:28)
at declareSourceFileMember (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:22646:19)
[Info - 1:51:03 AM] Connection to server got closed. Server will restart.
/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10566
throw new Error("start < 0");
^

Error: start < 0
at createTextSpan (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10566:19)
at Object.createTextSpanFromBounds (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10575:16)
at getErrorSpanForNode (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:7075:19)
at createDiagnosticForNodeInSourceFile (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:6999:20)
at Object.createDiagnosticForNode (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:6995:16)
at /Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21582:58
at Object.forEach (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:1423:30)
at declareSymbol (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21581:28)
at declareModuleMember (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21600:28)
at declareSourceFileMember (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:22646:19)
[Info - 1:51:05 AM] Connection to server got closed. Server will restart.
/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10566
throw new Error("start < 0");
^

Error: start < 0
at createTextSpan (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10566:19)
at Object.createTextSpanFromBounds (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10575:16)
at getErrorSpanForNode (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:7075:19)
at createDiagnosticForNodeInSourceFile (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:6999:20)
at Object.createDiagnosticForNode (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:6995:16)
at /Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21582:58
at Object.forEach (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:1423:30)
at declareSymbol (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21581:28)
at declareModuleMember (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21600:28)
at declareSourceFileMember (/Users/JzKUO/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:22646:19)
[Error - 1:51:07 AM] Connection to server got closed. Server will not be restarted.
`

0.0.9更新之后,代码高亮和代码提示都没有了

vscode 1.91
vueHelper 0.0.9
vetur 0.3.6
macOS 10.12.2

代码片段

<template lang="pug">
  section#driver-team
    z-nav(title="当前隶属车队")
      router-link.button.button-fill.button-form(:to="{ name: 'DriverCar' }") 下一步
</template>

<style lang="stylus">
#driver-team
  .top
    background #fff
    select
      float right

</style>

<script lang="babel">
import Driver from '../services/Driver.js'
export default {
  name: 'driver-team',
  data() {
    return {
      driver: new Driver(),
      teams: [
         {companyName:'', companyAddress:'', contactMobile:'', contactName:'', id:''}
      ]
    }
  },

</script>

更新前0.0.9之前<script>部分有高亮和提示,'template'部分有提示和高亮,<style>部分有高亮无提示
更新后,所有部分均失去了提示功能,<script>连高亮都没了

已将vueHelper 、vetur重新卸载并安装。依然没有变化
setting中的配置存在或删除均没有用,之前一直开着这个设置,有高亮有提示

  "files.associations": {
    "*.vue": "vue"
  }

新版本下
即使开着js,<script>和'template' 部分均没有提示,之前不开js也是有提示的。

关于vscode文件配置

是否需要在setting.json中如下配置:

 "files.associations": {
        "*.vue": "vue"
     }

看到很多vue插件都需要这样配置,不知道该插件需要这么配置么?

关于组件内导航钩子的语法错误

输入beforeRouteEnter和beforeRouteLeave,得出
beforeRouteEnter((to, from, next) => {
//does NOT have access to this component instance

}),语法报错,应该改成
beforeRouteEnter(to, from, next) {
//does NOT have access to this component instance

}这样才对

Don't get any suggestion

Hello,

I have the latest version installed on vscode 1.10.2
However, when I edit a .vue file I don't get any suggestion. For example, I expect this to provide a compilled description

<script>

export default {
    
    comp
}

</script>

But instead I get nothing.
May this be a collision with any other plugin?

Drop syntax definition and split snippets for each languages

Hello, I'm working on vetur, and in 0.3.3 I tweaked embedded snippet support.

For the following code, vetur now will mark each region correctly with its embedded language, like this:

<template>          // vue
                    // html
</template>         // vue
                    // vue
<style>             // vue
div .test {         // css
  list-style: none; // css
}                   // css
</style>            // vue

And snippets will work this way:

  • In vue region, vue snippet will be available
  • In html region, html snippet will be available
  • In css region, css snippet will be available

This applies to all other languages, like scss, stylus, js, ts, etc.

Would you mind

  • Suggest users to install vetur and drop the syntax definition in VueHelper. Currently the outdated syntax definition will override vetur's, and it doesn't mark regions and embedded languages correctly. Also I don't want the old syntax definition to be floating around.
  • Split snippets into each languages. Now I see you are putting main.json into all languages. For example, vue$on only applies to js or ts, but not css or scss. Once you put that snippet to a separate file, and only define it as a js snippet, it'll only popup in the <script> region in vue SFC.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.