Commit 0dd14040ec40ad62e75f348f91a7acbedcea0e2b

Authored by liuqimichale
1 parent 2521f09e

路由 favicon scss stick-footer reset.css 懒加载

webintroduce/build/webpack.base.conf.js
... ... @@ -64,7 +64,18 @@ module.exports = {
64 64 limit: 10000,
65 65 name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
66 66 }
  67 + },
  68 + {
  69 + test: /\.scss$/,
  70 + use: [{
  71 + loader: "style-loader" // creates style nodes from JS strings
  72 + }, {
  73 + loader: "css-loader" // translates CSS into CommonJS
  74 + }, {
  75 + loader: "sass-loader" // compiles Sass to CSS
  76 + }]
67 77 }
  78 +
68 79 ]
69 80 },
70 81 node: {
... ...
webintroduce/index.html
... ... @@ -2,8 +2,9 @@
2 2 <html>
3 3 <head>
4 4 <meta charset="utf-8">
5   - <meta name="viewport" content="width=device-width,initial-scale=1.0">
6   - <title>webintroduce</title>
  5 + <!--<meta name="viewport" content="width=device-width,initial-scale=1.0">-->
  6 + <link rel="shortcut icon" type="image/x-icon" href="static/favicon.ico">
  7 + <title>任你停官网</title>
7 8 </head>
8 9 <body>
9 10 <div id="app"></div>
... ...
webintroduce/package-lock.json
... ... @@ -4963,8 +4963,7 @@
4963 4963 },
4964 4964 "js-yaml": {
4965 4965 "version": "3.7.0",
4966   - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.7.0.tgz",
4967   - "integrity": "sha1-XJZ93YN6m/3KXy3oQlOr6KHAO4A=",
  4966 + "resolved": "",
4968 4967 "dev": true,
4969 4968 "requires": {
4970 4969 "argparse": "^1.0.7",
... ... @@ -9513,6 +9512,18 @@
9513 9512 "mkdirp": "~0.5.1",
9514 9513 "sax": "~1.2.1",
9515 9514 "whet.extend": "~0.9.9"
  9515 + },
  9516 + "dependencies": {
  9517 + "js-yaml": {
  9518 + "version": "3.7.0",
  9519 + "resolved": "http://registry.npm.taobao.org/js-yaml/download/js-yaml-3.7.0.tgz",
  9520 + "integrity": "sha1-XJZ93YN6m/3KXy3oQlOr6KHAO4A=",
  9521 + "dev": true,
  9522 + "requires": {
  9523 + "argparse": "^1.0.7",
  9524 + "esprima": "^2.6.0"
  9525 + }
  9526 + }
9516 9527 }
9517 9528 },
9518 9529 "tapable": {
... ...
webintroduce/package.json
... ... @@ -31,6 +31,7 @@
31 31 "friendly-errors-webpack-plugin": "^1.6.1",
32 32 "html-webpack-plugin": "^2.30.1",
33 33 "node-notifier": "^5.1.2",
  34 + "node-sass": "^4.11.0",
34 35 "optimize-css-assets-webpack-plugin": "^3.2.0",
35 36 "ora": "^1.2.0",
36 37 "portfinder": "^1.0.13",
... ... @@ -38,6 +39,7 @@
38 39 "postcss-loader": "^2.0.8",
39 40 "postcss-url": "^7.2.1",
40 41 "rimraf": "^2.6.0",
  42 + "sass-loader": "^7.1.0",
41 43 "semver": "^5.3.0",
42 44 "shelljs": "^0.7.6",
43 45 "uglifyjs-webpack-plugin": "^1.1.1",
... ...
webintroduce/src/App.vue
1 1 <template>
2 2 <div id="app">
3   - <img src="./assets/logo.png">
4   - <router-view/>
  3 + <VHeader></VHeader>
  4 + <div class="main-wrap">
  5 + <router-view/>
  6 + </div>
  7 +
  8 + <VFooter></VFooter>
5 9 </div>
6 10 </template>
7 11  
8 12 <script>
  13 +import VHeader from './components/VHeader'
  14 +import VFooter from './components/VFooter'
9 15 export default {
10   - name: 'App'
  16 + name: 'App',
  17 + components:{
  18 + VHeader,
  19 + VFooter
  20 + }
11 21 }
12 22 </script>
13 23  
14 24 <style>
15 25 #app {
  26 + display: flex;
  27 + flex-flow: column;
  28 + min-height: 100vh;
16 29 font-family: 'Avenir', Helvetica, Arial, sans-serif;
17 30 -webkit-font-smoothing: antialiased;
18 31 -moz-osx-font-smoothing: grayscale;
19 32 text-align: center;
20 33 color: #2c3e50;
21   - margin-top: 60px;
22 34 }
  35 + .main-wrap{
  36 + flex: 1;
  37 + }
23 38 </style>
... ...
webintroduce/src/assets/css/reset.css 0 → 100644
  1 +/* http://meyerweb.com/eric/tools/css/reset/
  2 + v4.0 | 20180602
  3 + License: none (public domain)
  4 +*/
  5 +
  6 +html, body, div, span, applet, object, iframe,
  7 +h1, h2, h3, h4, h5, h6, p, blockquote, pre,
  8 +a, abbr, acronym, address, big, cite, code,
  9 +del, dfn, em, img, ins, kbd, q, s, samp,
  10 +small, strike, strong, sub, sup, tt, var,
  11 +b, u, i, center,
  12 +dl, dt, dd, ol, ul, li,
  13 +fieldset, form, label, legend,
  14 +table, caption, tbody, tfoot, thead, tr, th, td,
  15 +article, aside, canvas, details, embed,
  16 +figure, figcaption, footer, header, hgroup,
  17 +main, menu, nav, output, ruby, section, summary,
  18 +time, mark, audio, video {
  19 + margin: 0;
  20 + padding: 0;
  21 + border: 0;
  22 + font-size: 100%;
  23 + font: inherit;
  24 + vertical-align: baseline;
  25 +}
  26 +
  27 +/* HTML5 display-role reset for older browsers */
  28 +article, aside, details, figcaption, figure,
  29 +footer, header, hgroup, main, menu, nav, section {
  30 + display: block;
  31 +}
  32 +
  33 +/* HTML5 hidden-attribute fix for newer browsers */
  34 +*[hidden] {
  35 + display: none;
  36 +}
  37 +
  38 +body {
  39 + line-height: 1;
  40 +}
  41 +
  42 +/*html, body {*/
  43 +/*width: 100%;*/
  44 +/*height: 100%;*/
  45 +/*background: url("../assets/img/bg.jpg") no-repeat;*/
  46 +/*background-size: 100% 100%;*/
  47 +/*overflow: hidden;*/
  48 +/*}*/
  49 +
  50 +html, body{
  51 + height: 100%;width: 100%;
  52 + font-family: "Microsoft YaHei";
  53 + color: #fff;
  54 + user-select: none;
  55 + -webkit-user-select: none;
  56 + -ms-user-select: none;
  57 + -o-user-select: none;
  58 + -moz-user-select: none;
  59 +}
  60 +body{
  61 +
  62 + overflow: hidden;
  63 + font-size: 14px;
  64 + /*默认颜色*/
  65 +}
  66 +
  67 +html {
  68 + box-sizing: border-box;
  69 +}
  70 +*, *:before, *:after {
  71 + box-sizing: inherit;
  72 +}
  73 +
  74 +ol, ul {
  75 + list-style: none;
  76 +}
  77 +
  78 +blockquote, q {
  79 + quotes: none;
  80 +}
  81 +
  82 +blockquote:before, blockquote:after,
  83 +q:before, q:after {
  84 + content: '';
  85 + content: none;
  86 +}
  87 +
  88 +table {
  89 + border-collapse: collapse;
  90 + border-spacing: 0;
  91 +}
  92 +
  93 +/*清除浮动*/
  94 +.clearfix:before,
  95 +.clearfix:after {
  96 + content: " ";
  97 + display: inline-block;
  98 + height: 0;
  99 + clear: both;
  100 + visibility: hidden;
  101 +}
  102 +
  103 +.clearfix {
  104 + *zoom: 1;
  105 +}
  106 +
  107 +/*隐藏*/
  108 +.dn {
  109 + display: none;
  110 +}
  111 +
  112 +.margin0-12 {
  113 + margin: 0 12px;
  114 +}
  115 +
  116 +.margin12-0 {
  117 + margin: 12px 0;
  118 +}
  119 +.flexfm{
  120 + flex: 1;
  121 +}
  122 +
  123 +.pos-rel{
  124 + position: relative;
  125 +}
  126 +.pos-abs{
  127 + position: absolute;
  128 +}
  129 +
  130 +
  131 +
  132 +
  133 +
  134 +/*自定义导航选中样式*/
  135 +.navActive{
  136 + background-color: #f00;
  137 +}
... ...
webintroduce/src/assets/logo.png deleted

6.69 KB

webintroduce/src/components/HelloWorld.vue deleted
1   -<template>
2   - <div class="hello">
3   - <h1>{{ msg }}</h1>
4   - <h2>Essential Links</h2>
5   - <ul>
6   - <li>
7   - <a
8   - href="https://vuejs.org"
9   - target="_blank"
10   - >
11   - Core Docs
12   - </a>
13   - </li>
14   - <li>
15   - <a
16   - href="https://forum.vuejs.org"
17   - target="_blank"
18   - >
19   - Forum
20   - </a>
21   - </li>
22   - <li>
23   - <a
24   - href="https://chat.vuejs.org"
25   - target="_blank"
26   - >
27   - Community Chat
28   - </a>
29   - </li>
30   - <li>
31   - <a
32   - href="https://twitter.com/vuejs"
33   - target="_blank"
34   - >
35   - Twitter
36   - </a>
37   - </li>
38   - <br>
39   - <li>
40   - <a
41   - href="http://vuejs-templates.github.io/webpack/"
42   - target="_blank"
43   - >
44   - Docs for This Template
45   - </a>
46   - </li>
47   - </ul>
48   - <h2>Ecosystem</h2>
49   - <ul>
50   - <li>
51   - <a
52   - href="http://router.vuejs.org/"
53   - target="_blank"
54   - >
55   - vue-router
56   - </a>
57   - </li>
58   - <li>
59   - <a
60   - href="http://vuex.vuejs.org/"
61   - target="_blank"
62   - >
63   - vuex
64   - </a>
65   - </li>
66   - <li>
67   - <a
68   - href="http://vue-loader.vuejs.org/"
69   - target="_blank"
70   - >
71   - vue-loader
72   - </a>
73   - </li>
74   - <li>
75   - <a
76   - href="https://github.com/vuejs/awesome-vue"
77   - target="_blank"
78   - >
79   - awesome-vue
80   - </a>
81   - </li>
82   - </ul>
83   - </div>
84   -</template>
85   -
86   -<script>
87   -export default {
88   - name: 'HelloWorld',
89   - data () {
90   - return {
91   - msg: 'Welcome to Your Vue.js App'
92   - }
93   - }
94   -}
95   -</script>
96   -
97   -<!-- Add "scoped" attribute to limit CSS to this component only -->
98   -<style scoped>
99   -h1, h2 {
100   - font-weight: normal;
101   -}
102   -ul {
103   - list-style-type: none;
104   - padding: 0;
105   -}
106   -li {
107   - display: inline-block;
108   - margin: 0 10px;
109   -}
110   -a {
111   - color: #42b983;
112   -}
113   -</style>
webintroduce/src/components/VFooter.vue 0 → 100644
  1 +<template>
  2 + <div class="footer-wrap">底部</div>
  3 +</template>
  4 +
  5 +<script>
  6 +export default {
  7 + name: 'VFooter'
  8 +}
  9 +</script>
  10 +
  11 +<style scoped>
  12 +.footer-wrap{
  13 + height: 100px;
  14 + background: #0f0;
  15 +}
  16 +</style>
... ...
webintroduce/src/components/VHeader.vue 0 → 100644
  1 +<template>
  2 + <div class="header-wrap">
  3 + <ul>
  4 + <router-link
  5 + :to="{path:link.linkPath}"
  6 + tag="li" v-for="(link,index) in navLinks"
  7 + :key="index"
  8 + @click="navChange(index)"
  9 + exact="">
  10 + {{link.name}}
  11 + </router-link>
  12 + </ul>
  13 + </div>
  14 +</template>
  15 +
  16 +<script>
  17 +export default {
  18 + name: 'VHeader',
  19 + data() {
  20 + return {
  21 + navLinks: [
  22 + {name:'首页',linkPath:'/home'},
  23 + {name:'解决方案',linkPath:'/solution'}
  24 + ]
  25 + }
  26 + },
  27 + methods:{
  28 + navChange(index) {
  29 +
  30 + }
  31 + }
  32 +}
  33 +</script>
  34 +
  35 +<style scoped lang="scss">
  36 +.header-wrap{
  37 + height: 100px;
  38 + background-color: burlywood;
  39 +}
  40 +</style>
... ...
webintroduce/src/main.js
... ... @@ -4,6 +4,7 @@ import Vue from &#39;vue&#39;
4 4 import App from './App'
5 5 import router from './router'
6 6  
  7 +require ('./assets/css/reset.css')
7 8 Vue.config.productionTip = false
8 9  
9 10 /* eslint-disable no-new */
... ...
webintroduce/src/router/index.js
1 1 import Vue from 'vue'
2 2 import Router from 'vue-router'
3   -import HelloWorld from '@/components/HelloWorld'
  3 +import VHome from '../views/VHome'
  4 +const VSolution = () => import('../views/VSolution')
4 5  
5 6 Vue.use(Router)
6 7  
7 8 export default new Router({
  9 + linkExactActiveClass:'navActive',
8 10 routes: [
9 11 {
10 12 path: '/',
11   - name: 'HelloWorld',
12   - component: HelloWorld
13   - }
  13 + name: 'VHome',
  14 + component: VHome
  15 + },
  16 + {
  17 + path: '/home',
  18 + name: 'VHome',
  19 + component: VHome
  20 + },
  21 + {
  22 + path: '/solution',
  23 + name: 'VSolution',
  24 + component: VSolution
  25 + },
14 26 ]
15 27 })
... ...
webintroduce/src/views/VHome.vue 0 → 100644
  1 +<template>
  2 + <div>home</div>
  3 +</template>
  4 +
  5 +<script>
  6 +export default {
  7 + name: 'VHome'
  8 +}
  9 +</script>
  10 +
  11 +<style scoped lang="scss">
  12 +
  13 +</style>
... ...
webintroduce/src/views/VSolution.vue 0 → 100644
  1 +<template>
  2 + <div>解决方案</div>
  3 +</template>
  4 +
  5 +<script>
  6 +export default {
  7 + name: 'VSolution'
  8 +}
  9 +</script>
  10 +
  11 +<style scoped lang="scss">
  12 +
  13 +</style>
... ...
webintroduce/static/favicon.ico 0 → 100644
No preview for this file type