mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-12 06:15:45 +08:00
* Add support to x vversion from npm * Add support to x vversion from npm * Add support to x vversion from npm * Add documentation for current repository
20 lines
1.2 KiB
Markdown
20 lines
1.2 KiB
Markdown
# New <Badge text="v4.0.0+"/>
|
|
|
|
In daily work, the most common is to write modules and business components. When you open a new `view` or `component` every time you need to manually create a new `.vue`, create a `<template>`, `<script>`, `<style>`, or some problem.
|
|
|
|
So in the new version, based on [plop](https://github.com/amwmedia/plop), several basic templates are provided to facilitate the creation of the new `view` or`component`.
|
|
|
|
Execute the following command:
|
|
|
|
```bash
|
|
npm run new
|
|
```
|
|
|
|

|
|
|
|
As shown in the previous gif, it is easy to generate the basic code snippet I want by simply pressing Enter several times. This is just a demonstration, you can customize the template according to your needs.
|
|
|
|
For additional template requirements, you can create a custom template by following the `plop` documentation and going to the `plop-templates` directory.
|
|
|
|
In fact, this feature is similar to what snippets do. If you think the configuration is too complicated, you can install a code fragment based on VSCode such as [Vue 2 Snippets](https://marketplace.visualstudio.com/items?itemName=hollowtree.vue-snippets).
|