This repository was archived by the owner on May 14, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +68
-36
lines changed Expand file tree Collapse file tree 3 files changed +68
-36
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" wrapper" id =" app" >
3
3
<bc-header ></bc-header >
4
- <div class =" page" >
5
- <section class =" search" >
6
- <div class =" container" >
7
- <div class =" box-1" >
8
- <search-box ></search-box >
9
- </div >
10
- </div >
11
- </section >
12
- <section class =" brand" >
13
- <div class =" container" >
14
- <brand-row v-for =" item in colorData" >
15
- <h2 slot =" title" >{{ item.name }}</h2 >
16
-
17
- <template v-for =" color in item .colors " >
18
- <color-box slot =" colors" :color =" color" ></color-box >
19
- </template >
20
- </brand-row >
21
- </div >
22
- </section >
23
- </div >
4
+ <router-view ></router-view >
24
5
</div >
25
6
</template >
26
7
27
8
<script >
28
- /* eslint-disable object-shorthand */
29
-
30
9
import BcHeader from ' ./components/header.vue' ;
31
- import SearchBox from ' ./components/search-box.vue' ;
32
- import BrandRow from ' ./components/brand-row.vue' ;
33
- import ColorBox from ' ./components/color-box.vue' ;
34
-
35
- import colorData from ' ./assets/data.json' ;
36
10
37
11
export default {
38
- data () {
39
- return {
40
- colorData: colorData,
41
- };
42
- },
43
12
components: {
44
13
BcHeader,
45
- SearchBox,
46
- BrandRow,
47
- ColorBox,
48
14
},
49
15
};
50
16
</script >
Original file line number Diff line number Diff line change @@ -5,9 +5,23 @@ import Vue from 'vue';
5
5
import VueRouter from 'vue-router' ;
6
6
import App from './App.vue' ;
7
7
8
+ import HomePage from './pages/Home.vue' ;
9
+
8
10
import Style from './style.scss' ;
9
11
12
+ Vue . use ( VueRouter ) ;
13
+
14
+ const routes = [
15
+ { path : '/' , component : HomePage } ,
16
+ ] ;
17
+
18
+ const router = new VueRouter ( {
19
+ mode : 'history' ,
20
+ routes,
21
+ } ) ;
22
+
10
23
const app = new Vue ( {
11
24
el : '#app' ,
12
25
render : h => h ( App ) ,
13
- } ) ;
26
+ router,
27
+ } ) . $mount ( '#app' ) ;
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" page" >
3
+ <section class =" search" >
4
+ <div class =" container" >
5
+ <div class =" box-1" >
6
+ <search-box ></search-box >
7
+ </div >
8
+ </div >
9
+ </section >
10
+ <section class =" brand" >
11
+ <div class =" container" >
12
+ <brand-row v-for =" item in colorData" >
13
+ <h2 slot =" title" >{{ item.name }}</h2 >
14
+
15
+ <template v-for =" color in item .colors " >
16
+ <color-box slot =" colors" :color =" color" ></color-box >
17
+ </template >
18
+ </brand-row >
19
+ </div >
20
+ </section >
21
+ </div >
22
+ </template >
23
+
24
+ <script >
25
+ /* eslint-disable object-shorthand */
26
+
27
+ import Clipboard from ' clipboard' ;
28
+
29
+ import SearchBox from ' ../components/search-box.vue' ;
30
+ import BrandRow from ' ../components/brand-row.vue' ;
31
+ import ColorBox from ' ../components/color-box.vue' ;
32
+
33
+ import colorData from ' ../assets/data.json' ;
34
+
35
+ export default {
36
+ data () {
37
+ return {
38
+ colorData: colorData,
39
+ };
40
+ },
41
+ components: {
42
+ SearchBox,
43
+ BrandRow,
44
+ ColorBox,
45
+ },
46
+ created : function () {
47
+ const clipboard = new Clipboard (' .color-box' );
48
+ clipboard .on (' success' , () => {
49
+ });
50
+ },
51
+ };
52
+ </script >
You can’t perform that action at this time.
0 commit comments