Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hs-sky-ui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
何虹
hs-sky-ui
Commits
d19a21ae
Commit
d19a21ae
authored
May 08, 2020
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试
parent
22cbc466
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
+26
-10
main.js
src/main.js
+2
-1
index.js
src/packages/index.js
+24
-9
No files found.
src/main.js
View file @
d19a21ae
...
@@ -3,9 +3,10 @@ window.Vue=Vue
...
@@ -3,9 +3,10 @@ window.Vue=Vue
import
App
from
'./App.vue'
import
App
from
'./App.vue'
import
ElementUI
from
'element-ui'
import
ElementUI
from
'element-ui'
import
'element-ui/lib/theme-chalk/index.css'
import
'element-ui/lib/theme-chalk/index.css'
import
'./packages/index'
import
tt
from
'./packages/index'
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
Vue
.
use
(
ElementUI
)
Vue
.
use
(
ElementUI
)
Vue
.
use
(
tt
)
new
Vue
({
new
Vue
({
render
:
h
=>
h
(
App
)
render
:
h
=>
h
(
App
)
}).
$mount
(
'#app'
)
}).
$mount
(
'#app'
)
src/packages/index.js
View file @
d19a21ae
import
Vue
from
'vue'
import
Vue
from
'vue'
const
requireComponent_
=
require
.
context
(
'./'
,
true
,
/index.vue$/
)
const
requireComponent_
=
require
.
context
(
'./'
,
true
,
/index.vue$/
)
const
obj
=
{}
const
obj
=
{}
requireComponent_
.
keys
().
forEach
(
fileName
=>
{
const
install
=
function
(
Vue
)
{
const
componentConfig
=
requireComponent_
(
fileName
)
if
(
install
.
installed
)
return
;
const
{
name
}
=
componentConfig
.
default
requireComponent_
.
keys
().
forEach
(
fileName
=>
{
if
(
name
)
{
const
componentConfig
=
requireComponent_
(
fileName
)
Vue
.
component
(
name
,
componentConfig
.
default
||
componentConfig
)
const
{
name
}
=
componentConfig
.
default
obj
[
name
]
=
componentConfig
if
(
name
)
{
}
Vue
.
component
(
name
,
componentConfig
.
default
||
componentConfig
)
})
obj
[
name
]
=
componentConfig
}
})
};
// if (typeof window !== 'undefined' && window.Vue || Vue) {
// install(window.Vue || Vue);
// }
// requireComponent_.keys().forEach(fileName => {
// const componentConfig = requireComponent_(fileName)
// const { name } = componentConfig.default
// if (name) {
// Vue.component(name, componentConfig.default || componentConfig)
// obj[name] = componentConfig
// }
// })
obj
.
install
=
install
export
default
obj
export
default
obj
\ 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