Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create layouts/pages/components based on templates #8

Open
4 of 7 tasks
lukadriel7 opened this issue Dec 14, 2020 · 3 comments
Open
4 of 7 tasks

Create layouts/pages/components based on templates #8

lukadriel7 opened this issue Dec 14, 2020 · 3 comments

Comments

@lukadriel7
Copy link

RFC (Request for Comments) Template

Please select your type of RFC (one or more):

Put an x in the boxes that apply

  • Change ?
  • Method ?
  • Behavior ?
  • Research ?
  • Innovation ?

Other

  • Start Date: 2020-12-14
  • Target Major Version: 2.x

Does this introduce a breaking change?

Put an x in the box that applies

  • Yes
  • No

Proposed RFC

Add the possibility to use templates while creating layouts/pages/components/boot with quasar cli.
Currently, creating any file using the quasar cli results in some default code being generated for the file.
Some component such as QDialog almost all implement the same code. Adding the ability to specify the template
of the component at create time using a command such as quasar new component --template dialog which would result in the component being created with the code recommended here would reduce some repetitive task.
A new folder named templates could be added in the src folder allowing users to store custom templates they could use to create pages or components.

Possible Folder Structure

└── src/
│   └── templates/
│       ├── components/
│       │   └── dialog.vue
│       ├── layouts/
│       │   └── youtube.vue
│       │   └── github.vue
│       ├── page/
│       │   └── login.vue
│       │   └── profile.vue
└── quasar.conf.js
@geoidesic
Copy link

Sounds like a lot of work for the Quasar team so that you can avoid hitting CRTL+V, CTRL+C. Or am I missing something?

@m0jimo
Copy link

m0jimo commented Dec 14, 2020

I agree with @lukadriel7. When adding a new component I've to add plenty of code which is the same across all components. Really nice example is dialog with its configuration and custom template part.

Maybe a new Quasar extension could the job for templates?

@lukadriel7
Copy link
Author

@geoidesic not only avoiding copy-paste, it could be the basis to enable users to share their own template and make it accessible to others directly from a quasar project. Kinda how extensions work but with templates. This of course being a long term objective.
I understand your point, but then again we have a command to create pages, components and layout when we could just create a new file and paste or write some code there by ourselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants