Initial
This commit is contained in:
.editorconfig.env.development.env.production.env.staging.eslintignore.eslintrc.js.gitignoreREADME.mdbabel.config.js
build
jest.config.jsjsconfig.jsonmock
package.jsonplop-templates
plopfile.jspostcss.config.jspublic
src
App.vue
api
assets
401_images
404_images
custom-theme
logo
components
BackToTop
Breadcrumb
Charts
DndList
DragSelect
Dropzone
ErrorLog
GithubCorner
Hamburger
HeaderSearch
ImageCropper
JsonEditor
Kanban
MDinput
MarkdownEditor
Pagination
PanThumb
RightPanel
Screenfull
Share
SizeSelect
Sticky
SvgIcon
TextHoverEffect
ThemePicker
Tinymce
Upload
UploadExcel
directive
filters
icons
index.js
svg
404.svgbug.svgchart.svgclipboard.svgcomponent.svgdashboard.svgdocumentation.svgdrag.svgedit.svgeducation.svgemail.svgexample.svgexcel.svgexit-fullscreen.svgeye-open.svgeye.svgform.svgfullscreen.svgguide.svgicon.svginternational.svglanguage.svglink.svglist.svglock.svgmessage.svgmoney.svgnested.svgpassword.svgpdf.svgpeople.svgpeoples.svgqq.svgsearch.svgshopping.svgsize.svgskill.svgstar.svgtab.svgtable.svgtheme.svgtree-table.svgtree.svguser.svgwechat.svgzip.svg
svgo.ymllayout
main.jspermission.jsrouter
settings.jsstore
styles
btn.scsselement-ui.scsselement-variables.scssindex.scssmixin.scsssidebar.scsstransition.scssvariables.scss
utils
auth.jsclipboard.jserror-log.jsget-page-title.jsindex.jsopen-window.jspermission.jsrequest.jsscroll-to.jsvalidate.js
vendor
views
charts
chatbot
clipboard
components-demo
avatar-upload.vueback-to-top.vuecount-to.vuednd-list.vuedrag-dialog.vuedrag-kanban.vuedrag-select.vuedropzone.vuejson-editor.vuemarkdown.vuemixin.vuesplit-pane.vuesticky.vuetinymce.vue
dashboard
admin
components
BarChart.vueBoxCard.vueLineChart.vuePanelGroup.vuePieChart.vueRaddarChart.vue
index.vueTodoList
TransactionTable.vuemixins
editor
index.vuedocumentation
error-log
error-page
example
excel
guide
icons
login
nested
menu1
menu2
pdf
permission
profile
qiniu
redirect
tab
table
theme
zip
tests/unit
vue.config.js
26
plop-templates/component/index.hbs
Normal file
26
plop-templates/component/index.hbs
Normal file
@ -0,0 +1,26 @@
|
||||
{{#if template}}
|
||||
<template>
|
||||
<div />
|
||||
</template>
|
||||
{{/if}}
|
||||
|
||||
{{#if script}}
|
||||
<script>
|
||||
export default {
|
||||
name: '{{ properCase name }}',
|
||||
props: {},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
{{/if}}
|
||||
|
||||
{{#if style}}
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
{{/if}}
|
55
plop-templates/component/prompt.js
Normal file
55
plop-templates/component/prompt.js
Normal file
@ -0,0 +1,55 @@
|
||||
const { notEmpty } = require('../utils.js')
|
||||
|
||||
module.exports = {
|
||||
description: 'generate vue component',
|
||||
prompts: [{
|
||||
type: 'input',
|
||||
name: 'name',
|
||||
message: 'component name please',
|
||||
validate: notEmpty('name')
|
||||
},
|
||||
{
|
||||
type: 'checkbox',
|
||||
name: 'blocks',
|
||||
message: 'Blocks:',
|
||||
choices: [{
|
||||
name: '<template>',
|
||||
value: 'template',
|
||||
checked: true
|
||||
},
|
||||
{
|
||||
name: '<script>',
|
||||
value: 'script',
|
||||
checked: true
|
||||
},
|
||||
{
|
||||
name: 'style',
|
||||
value: 'style',
|
||||
checked: true
|
||||
}
|
||||
],
|
||||
validate(value) {
|
||||
if (value.indexOf('script') === -1 && value.indexOf('template') === -1) {
|
||||
return 'Components require at least a <script> or <template> tag.'
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
],
|
||||
actions: data => {
|
||||
const name = '{{properCase name}}'
|
||||
const actions = [{
|
||||
type: 'add',
|
||||
path: `src/components/${name}/index.vue`,
|
||||
templateFile: 'plop-templates/component/index.hbs',
|
||||
data: {
|
||||
name: name,
|
||||
template: data.blocks.includes('template'),
|
||||
script: data.blocks.includes('script'),
|
||||
style: data.blocks.includes('style')
|
||||
}
|
||||
}]
|
||||
|
||||
return actions
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user