Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
schbrain-archetype-initializer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tools
schbrain-archetype-initializer
Commits
7a68aee6
Commit
7a68aee6
authored
Apr 08, 2022
by
liaozan
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: rewrite with vue3
parent
0c0b7062
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
83 deletions
+30
-83
initializer-ui/package.json
initializer-ui/package.json
+4
-8
initializer-ui/src/components/starter.vue
initializer-ui/src/components/starter.vue
+21
-32
initializer-ui/src/main.ts
initializer-ui/src/main.ts
+3
-1
initializer-ui/vite.config.ts
initializer-ui/vite.config.ts
+2
-42
No files found.
initializer-ui/package.json
View file @
7a68aee6
...
...
@@ -6,18 +6,14 @@
"build"
:
"vite build --mode production"
},
"dependencies"
:
{
"@vitejs/plugin-vue"
:
"^2.3.1"
,
"ant-design-vue"
:
"^3.1.1"
,
"axios"
:
"^0.26.1"
,
"consola"
:
"^2.15.3"
,
"vite-plugin-style-import"
:
"^1.4.1"
,
"vue"
:
"^3.2.31"
},
"devDependencies"
:
{
"@vue/compiler-sfc"
:
"^3.2.31"
,
"less"
:
"^4.1.2"
,
"sass"
:
"^1.50.0"
,
"unplugin-vue-components"
:
"^0.18.5"
,
"vite"
:
"^2.9.1"
"@vitejs/plugin-vue"
:
"^2.3.1"
,
"typescript"
:
"^4.6.3"
,
"vite"
:
"^2.9.1"
,
"vue-tsc"
:
"^0.33.9"
}
}
\ No newline at end of file
initializer-ui/src/components/starter.vue
View file @
7a68aee6
...
...
@@ -2,7 +2,7 @@
<div
class=
"start-wrapper"
>
<a-spin
:spinning=
"loading"
>
<h3
style=
"margin-bottom: 20px"
>
项目初始代码生成
</h3>
<a-form
ref=
"downloadForm"
:labelCol=
"
{span: 6}" :model="formState" :rules="formRules" :wrapperCol="{span: 18}" class="form-wrapper">
<a-form
ref=
"downloadForm"
:labelCol=
"
{span: 6}" :model="formState" :rules="formRules" :wrapperCol="{span: 18}"
autocomplete="off"
class="form-wrapper">
<a-form-item
has-feedback
label=
"GroupId"
name=
"groupId"
>
<a-input
v-model:value=
"formState.groupId"
/>
</a-form-item>
...
...
@@ -121,50 +121,39 @@ const createTreeData = (fileNodeList: FileNode[]): any => {
return
[]
}
return
fileNodeList
.
map
((
item
:
FileNode
)
=>
{
// 非叶子结点
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
Object
.
assign
(
item
,
{
key
:
item
.
fileContent
!
+
Math
.
random
(),
children
:
createTreeData
(
item
.
children
),
title
:
item
.
fileName
,
selectable
:
false
,
isLeaf
:
false
})
return
item
}
else
{
return
{
key
:
item
.
fileContent
!
+
Math
.
random
(),
title
:
item
.
fileName
,
children
:
[],
selectable
:
false
,
isLeaf
:
true
}
return
{
key
:
Math
.
random
(),
title
:
item
.
fileName
,
children
:
createTreeData
(
item
.
children
),
selectable
:
false
,
isLeaf
:
item
.
isFile
}
})
}
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
scoped
>
.start-wrapper
{
width
:
500px
;
min-height
:
300px
;
border-radius
:
8px
;
box-shadow
:
0
0
20px
gray
;
margin
:
100px
auto
;
padding
:
50px
;
padding
:
50px
}
.button-group
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
.button-group
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
}
.generic-btn
{
margin-left
:
10px
;
}
}
.generic-btn
{
margin-left
:
10px
;
}
:deep
(
.ant-input
),
:deep
(
.ant-btn
)
{
border-radius
:
6px
;
}
/*noinspection CssUnusedSymbol*/
.ant-input
,
.ant-btn
{
border-radius
:
6px
;
}
</
style
>
\ No newline at end of file
initializer-ui/src/main.ts
View file @
7a68aee6
import
{
createApp
}
from
'
vue
'
import
App
from
'
./App.vue
'
import
Antd
from
'
ant-design-vue
'
import
'
./index.css
'
import
'
ant-design-vue/dist/antd.css
'
;
createApp
(
App
).
mount
(
'
#app
'
)
\ No newline at end of file
createApp
(
App
).
use
(
Antd
).
mount
(
'
#app
'
)
\ No newline at end of file
initializer-ui/vite.config.ts
View file @
7a68aee6
import
Components
from
'
unplugin-vue-components/vite
'
import
{
AntDesignVueResolver
}
from
'
unplugin-vue-components/resolvers
'
import
styleImport
,
{
AndDesignVueResolve
,
AntdResolve
}
from
'
vite-plugin-style-import
'
import
{
defineConfig
}
from
'
vite
'
// @ts-ignore
import
vue
from
'
@vitejs/plugin-vue
'
// noinspection JSUnusedGlobalSymbols
export
default
defineConfig
({
plugins
:
[
vue
(),
// antd自动按需引入
Components
({
resolvers
:
[
AntDesignVueResolver
(),
]
}),
// @ts-ignore
styleImport
({
resolves
:
[
AndDesignVueResolve
(),
AntdResolve
()
],
// 自定义规则
libs
:
[
{
libraryName
:
'
ant-design-vue
'
,
esModule
:
true
,
resolveStyle
:
(
name
:
any
)
=>
{
return
`ant-design-vue/es/
${
name
}
/style/index`
}
}
]
})
],
// 引用使用less的库要配置一下
css
:
{
preprocessorOptions
:
{
less
:
{
javascriptEnabled
:
true
}
}
},
// 让terminal显示network地址
server
:
{
host
:
'
0.0.0.0
'
}
plugins
:
[
vue
()]
})
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment