Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mould-vuecli3
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
lhfe
mould-vuecli3
Commits
956b7e9d
Commit
956b7e9d
authored
Aug 27, 2020
by
lipengcheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vuex模块化
parent
ebc6e850
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
70 additions
and
9 deletions
+70
-9
.prettierrc.js
.prettierrc.js
+1
-1
README.md
README.md
+1
-1
App.vue
src/App.vue
+1
-1
videoPlayer.vue
src/components/videoCutter/videoPlayer.vue
+4
-1
registerServiceWorker.js
src/registerServiceWorker.js
+4
-1
global.js
src/store/global.js
+21
-0
index.js
src/store/index.js
+7
-4
moduleA.js
src/store/modules/moduleA.js
+22
-0
vue.config.js
vue.config.js
+9
-0
No files found.
.prettierrc.js
View file @
956b7e9d
...
...
@@ -4,7 +4,7 @@ module.exports = {
// 与eslint集成(让prettier使用eslint的代码格式进行校验)
eslintIntegration
:
true
,
// 换行长度
printWidth
:
1
5
0
,
printWidth
:
1
2
0
,
// tab缩进大小,默认为2
tabWidth
:
4
,
// 使用tab缩进,默认false
...
...
README.md
View file @
956b7e9d
...
...
@@ -3,7 +3,7 @@
## 项目介绍
> node
12.18.3
> node
8.11.0+ (推荐12.18.3)
> npm 6.14.6
来画工具宝
...
...
src/App.vue
View file @
956b7e9d
...
...
@@ -21,7 +21,6 @@ export default {
return
{}
},
async
created
()
{
console
.
log
(
'this.$http:'
,
this
.
$http
)
let
result
=
await
this
.
$http
.
get
(
'/webapi/home/banner?type=1&category=18'
)
console
.
log
(
'result:'
,
result
)
}
...
...
@@ -44,5 +43,6 @@ export default {
flex
:
1
;
display
:
flex
;
justify-content
:
space-between
;
overflow
:
hidden
;
}
</
style
>
src/components/videoCutter/videoPlayer.vue
View file @
956b7e9d
<
template
>
<div
class=
"video-player"
>
<video
ref=
"videoDom"
src=
"https://resources.laihua.com/2020-7-27/547adf9b-73b0-4b14-bed6-6ee278a1b2b2.mp4"
></video>
<video
ref=
"videoDom"
src=
"https://resources.laihua.com/2020-7-27/547adf9b-73b0-4b14-bed6-6ee278a1b2b2.mp4"
></video>
</div>
</
template
>
<
script
>
...
...
src/registerServiceWorker.js
View file @
956b7e9d
...
...
@@ -5,7 +5,10 @@ import { register } from 'register-service-worker'
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
register
(
`
${
process
.
env
.
BASE_URL
}
service-worker.js`
,
{
ready
()
{
console
.
log
(
'App is being served from cache by a service worker.
\
n'
+
'For more details, visit https://goo.gl/AFskqB'
)
console
.
log
(
'App is being served from cache by a service worker.
\
n'
+
'For more details, visit https://goo.gl/AFskqB'
)
},
registered
()
{
console
.
log
(
'Service worker has been registered.'
)
...
...
src/store/global.js
0 → 100644
View file @
956b7e9d
// 全局vuex信息
// getter调用示例:this.$store.getters['test']
const
state
=
{
_test
:
1
}
const
getters
=
{
test
:
(
state
)
=>
state
.
_test
}
const
mutations
=
{}
const
actions
=
{}
export
default
{
state
,
getters
,
mutations
,
actions
}
src/store/index.js
View file @
956b7e9d
import
Vue
from
'vue'
import
Vuex
from
'vuex'
import
global
from
'./global'
import
moduleA
from
'./modules/moduleA'
Vue
.
use
(
Vuex
)
export
default
new
Vuex
.
Store
({
state
:
{}
,
m
utations
:
{},
actions
:
{},
modules
:
{
}
...
global
,
m
odules
:
{
moduleA
}
})
src/store/modules/moduleA.js
0 → 100644
View file @
956b7e9d
// 模块化vuex数据
// getter调用示例:this.$store.getters['moduleA/moduleState']
const
state
=
{
_moduleState
:
'moduleState'
}
const
getters
=
{
moduleState
:
(
state
)
=>
state
.
_moduleState
}
const
mutations
=
{}
const
actions
=
{}
export
default
{
namespaced
:
true
,
state
,
getters
,
mutations
,
actions
}
vue.config.js
View file @
956b7e9d
/*
* @Date: 2020-08-27 09:05:54
* @LastEditors: OBKoro1
* @LastEditTime: 2020-08-27 15:30:17
* @FilePath: /vue.config.js
* @Description: 描述
* @Author: huacong
* @
*/
// console.log(`process.env1:`, process.env);
console
.
log
(
`process.env.NODE_ENV1:`
,
process
.
env
.
NODE_ENV
)
...
...
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