Baozhangchao 3 years ago
parent
commit
418d7f9982

+ 4
- 0
build/webpack.base.conf.js View File

46
         loader: 'vue-loader',
46
         loader: 'vue-loader',
47
         options: vueLoaderConfig
47
         options: vueLoaderConfig
48
       },
48
       },
49
+      {
50
+        test: /\.scss$/,
51
+        loaders: ['style', 'css', 'sass']
52
+      },
49
       {
53
       {
50
         test: /\.js$/,
54
         test: /\.js$/,
51
         loader: 'babel-loader',
55
         loader: 'babel-loader',

+ 12798
- 0
package-lock.json
File diff suppressed because it is too large
View File


+ 4
- 0
package.json View File

44
     "postcss-loader": "^2.0.8",
44
     "postcss-loader": "^2.0.8",
45
     "postcss-url": "^7.2.1",
45
     "postcss-url": "^7.2.1",
46
     "rimraf": "^2.6.0",
46
     "rimraf": "^2.6.0",
47
+    "sass": "^1.49.7",
48
+    "sass-loader": "^7.3.1",
47
     "semver": "^5.3.0",
49
     "semver": "^5.3.0",
48
     "shelljs": "^0.7.6",
50
     "shelljs": "^0.7.6",
51
+    "style-loader": "^3.3.1",
52
+    "swiper": "^8.0.5",
49
     "uglifyjs-webpack-plugin": "^1.1.1",
53
     "uglifyjs-webpack-plugin": "^1.1.1",
50
     "url-loader": "^0.5.8",
54
     "url-loader": "^0.5.8",
51
     "vue-loader": "^13.3.0",
55
     "vue-loader": "^13.3.0",

+ 1
- 12
src/App.vue View File

1
 <template>
1
 <template>
2
   <div id="app">
2
   <div id="app">
3
-    <img src="./assets/logo.png">
4
-    <router-view/>
3
+    <router-view />
5
   </div>
4
   </div>
6
 </template>
5
 </template>
7
 
6
 
11
 }
10
 }
12
 </script>
11
 </script>
13
 
12
 
14
-<style>
15
-#app {
16
-  font-family: 'Avenir', Helvetica, Arial, sans-serif;
17
-  -webkit-font-smoothing: antialiased;
18
-  -moz-osx-font-smoothing: grayscale;
19
-  text-align: center;
20
-  color: #2c3e50;
21
-  margin-top: 60px;
22
-}
23
-</style>

BIN
src/assets/index/1.jpg View File


BIN
src/assets/index/点击开启.png View File


+ 43
- 0
src/components/Swiper/index.vue View File

1
+<template>
2
+  <div class="swiper-container">
3
+    <div class="swiper-wrapper">
4
+      <slot></slot>
5
+    </div>
6
+    <slot name="pagination"></slot>
7
+  </div>
8
+</template>
9
+
10
+<script>
11
+import Swiper from 'swiper'
12
+// import SwiperCore, { Autoplay, Pagination } from 'swiper/core'
13
+
14
+// SwiperCore.use([Autoplay, Pagination])
15
+
16
+export default {
17
+  name: 'Swiper',
18
+  props: {
19
+    options: {
20
+      type: Object,
21
+      default: () => ({})
22
+    }
23
+  },
24
+  data() {
25
+    return {
26
+      swiper: undefined
27
+    }
28
+  },
29
+  mounted() {
30
+    this.$nextTick(() => {
31
+      this.swiper = new Swiper(this.$el, this.options)
32
+      this.$emit('inited', this.swiper)
33
+    })
34
+  }
35
+}
36
+</script>
37
+
38
+<style>
39
+.swiper-container {
40
+  width: 100%;
41
+  height: 100%;
42
+}
43
+</style>

+ 32
- 0
src/components/SwiperSlide/index.vue View File

1
+<template>
2
+  <div class="swiper-slide">
3
+    <slot></slot>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+export default {
9
+  name: 'SwiperSlide'
10
+}
11
+</script>
12
+
13
+<style>
14
+.swiper-slide {
15
+  text-align: center;
16
+  background: #fff;
17
+
18
+  /* Center slide text vertically */
19
+  display: -webkit-box;
20
+  display: -ms-flexbox;
21
+  display: -webkit-flex;
22
+  display: flex;
23
+  -webkit-box-pack: center;
24
+  -ms-flex-pack: center;
25
+  -webkit-justify-content: center;
26
+  justify-content: center;
27
+  -webkit-box-align: center;
28
+  -ms-flex-align: center;
29
+  -webkit-align-items: center;
30
+  align-items: center;
31
+}
32
+</style>

+ 13
- 0
src/layouts/index.vue View File

1
+<template>
2
+  <router-view></router-view>
3
+</template>
4
+
5
+<script>
6
+
7
+export default {
8
+  name: 'AppLayout',
9
+  data() {
10
+    return {}
11
+  }
12
+}
13
+</script>

+ 4
- 1
src/main.js View File

3
 import Vue from 'vue'
3
 import Vue from 'vue'
4
 import App from './App'
4
 import App from './App'
5
 import router from './router'
5
 import router from './router'
6
+import Swiper from './components/Swiper'
7
+import SwiperSlide from './components/SwiperSlide'
6
 
8
 
7
 Vue.config.productionTip = false
9
 Vue.config.productionTip = false
8
-
10
+Vue.component('swiper', Swiper)
11
+Vue.component('swiper-slide', SwiperSlide)
9
 /* eslint-disable no-new */
12
 /* eslint-disable no-new */
10
 new Vue({
13
 new Vue({
11
   el: '#app',
14
   el: '#app',

+ 113
- 0
src/pages/IndexImage.vue
File diff suppressed because it is too large
View File


+ 17
- 0
src/pages/index.vue View File

1
+<template>
2
+  <div>
3
+    <h1>aaaaaaaaaaaaaaaa</h1>
4
+    <index-image></index-image>
5
+  </div>
6
+</template>
7
+
8
+<script>
9
+export default {
10
+  components: {
11
+    IndexImage: () => import('./IndexImage.vue')
12
+  }
13
+}
14
+</script>
15
+
16
+<style>
17
+</style>

+ 3
- 3
src/router/index.js View File

1
 import Vue from 'vue'
1
 import Vue from 'vue'
2
 import Router from 'vue-router'
2
 import Router from 'vue-router'
3
-import HelloWorld from '@/components/HelloWorld'
3
+import ColmoIndex from '@/pages'
4
 
4
 
5
 Vue.use(Router)
5
 Vue.use(Router)
6
 
6
 
8
   routes: [
8
   routes: [
9
     {
9
     {
10
       path: '/',
10
       path: '/',
11
-      name: 'HelloWorld',
12
-      component: HelloWorld
11
+      name: 'ColmoIndex',
12
+      component: ColmoIndex
13
     }
13
     }
14
   ]
14
   ]
15
 })
15
 })