Skip to content

Commit 49fd873

Browse files
苑朋飞苑朋飞
苑朋飞
authored and
苑朋飞
committed
add icon and readme
1 parent ac066bf commit 49fd873

File tree

4 files changed

+16
-75
lines changed

4 files changed

+16
-75
lines changed

README.md

Lines changed: 4 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,6 @@
1-
# createvueclasscomponent README
1+
# Create Vue Class Component
22

3-
This is the README for your extension "createvueclasscomponent". After writing up a brief description, we recommend including the following sections.
3+
> This is a VSCode plugin to help developer quickly create a class style component .vue file.
4+
> The reason I make it is to save my time in work, because my new team is still using Vue2 and write class style component, so I have to adapt to it.(I am a react user and favor into hooks and functional style.)
5+
> I hope this little tool will help you too.
46
5-
## Features
6-
7-
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
8-
9-
For example if there is an image subfolder under your extension project workspace:
10-
11-
\!\[feature X\]\(images/feature-x.png\)
12-
13-
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
14-
15-
## Requirements
16-
17-
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
18-
19-
## Extension Settings
20-
21-
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
22-
23-
For example:
24-
25-
This extension contributes the following settings:
26-
27-
* `myExtension.enable`: enable/disable this extension
28-
* `myExtension.thing`: set to `blah` to do something
29-
30-
## Known Issues
31-
32-
Calling out known issues can help limit users opening duplicate issues against your extension.
33-
34-
## Release Notes
35-
36-
Users appreciate release notes as you update your extension.
37-
38-
### 1.0.0
39-
40-
Initial release of ...
41-
42-
### 1.0.1
43-
44-
Fixed issue #.
45-
46-
### 1.1.0
47-
48-
Added features X, Y, and Z.
49-
50-
-----------------------------------------------------------------------------------------------------------
51-
## Following extension guidelines
52-
53-
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
54-
55-
* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines)
56-
57-
## Working with Markdown
58-
59-
**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
60-
61-
* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux)
62-
* Toggle preview (`Shift+CMD+V` on macOS or `Shift+Ctrl+V` on Windows and Linux)
63-
* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (macOS) to see a list of Markdown snippets
64-
65-
### For more information
66-
67-
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
68-
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
69-
70-
**Enjoy!**

images/vue_logo.png

4.12 KB
Loading

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22
"name": "createvueclasscomponent",
33
"displayName": "CreateVueClassComponent",
44
"description": "create vue class component",
5-
"version": "0.0.1",
5+
"icon": "images/vue_logo.png",
6+
"version": "0.0.2",
7+
"publisher": "pengfeiyuan",
68
"engines": {
79
"vscode": "^1.57.0"
810
},
911
"categories": [
1012
"Other"
1113
],
14+
"repository": {
15+
"url": "https://github.com/GitHubJiKe/createvueclasscomponent"
16+
},
1217
"activationEvents": [
1318
"*"
1419
],
@@ -23,9 +28,7 @@
2328
"keybindings": [
2429
{
2530
"command": "createvueclasscomponent.create",
26-
"key": "ctrl+f9",
27-
"mac": "cmd+n",
28-
"when": "editorTextFocus"
31+
"when": "explorerResourceIsFolder || resourceScheme == file"
2932
}
3033
],
3134
"menus": {
@@ -50,7 +53,7 @@
5053
"pretest": "npm run compile && npm run lint",
5154
"lint": "eslint src --ext ts",
5255
"test": "node ./out/test/runTest.js",
53-
"esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node",
56+
"esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node",
5457
"esbuild": "npm run -S esbuild-base -- --sourcemap",
5558
"esbuild-watch": "npm run -S esbuild-base -- --sourcemap --watch"
5659
},

src/createVueClassComponent.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ function createComponent(uri: { path: string }, componentName: string) {
3737

3838
const arr = uri.path.split('/');
3939

40-
arr.pop();
40+
if (fs.lstatSync(uri.path).isFile()) {
41+
arr.pop();
42+
}
4143

4244
const filePath = arr.join('/');
4345

@@ -52,7 +54,7 @@ module.exports = function (context: { subscriptions: any[]; }) {
5254
placeHolder: 'MyComponent',
5355
prompt: 'What is the name of the new component?',
5456
});
55-
57+
5658
createComponent(uri, convertComponentName(componentName!));
5759
}));
5860

0 commit comments

Comments
 (0)