Commit e7143ccc5ae343e68978c3fcdea9954fd1915de1

Authored by ykxie
1 parent b6d52239

添加sass

README.md
... ... @@ -28,3 +28,6 @@ npm test
28 28 ```
29 29  
30 30 For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
  31 +
  32 +# 安装npm
  33 +
... ...
build/webpack.base.conf.js
... ... @@ -67,6 +67,10 @@ module.exports = {
67 67 limit: 10000,
68 68 name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
69 69 }
  70 + },
  71 + {
  72 + test: /\.scss$/,
  73 + loaders: ["style", "css", "sass"]
70 74 }
71 75 ]
72 76 }
... ...
package.json
... ... @@ -14,6 +14,7 @@
14 14 },
15 15 "dependencies": {
16 16 "vue": "^2.1.10",
  17 + "vue-resource": "^1.2.0",
17 18 "vue-router": "^2.2.0"
18 19 },
19 20 "devDependencies": {
... ... @@ -21,19 +22,24 @@
21 22 "babel-core": "^6.22.1",
22 23 "babel-eslint": "^7.1.1",
23 24 "babel-loader": "^6.2.10",
  25 + "babel-plugin-istanbul": "^3.1.2",
24 26 "babel-plugin-transform-runtime": "^6.22.0",
25 27 "babel-preset-es2015": "^6.22.0",
26 28 "babel-preset-stage-2": "^6.22.0",
27 29 "babel-register": "^6.22.0",
  30 + "chai": "^3.5.0",
28 31 "chalk": "^1.1.3",
  32 + "chromedriver": "^2.27.2",
29 33 "connect-history-api-fallback": "^1.3.0",
30 34 "copy-webpack-plugin": "^4.0.1",
  35 + "cross-env": "^3.1.4",
  36 + "cross-spawn": "^5.0.1",
31 37 "css-loader": "^0.26.1",
32 38 "eslint": "^3.14.1",
  39 + "eslint-config-standard": "^6.2.1",
33 40 "eslint-friendly-formatter": "^2.0.7",
34 41 "eslint-loader": "^1.6.1",
35 42 "eslint-plugin-html": "^2.0.0",
36   - "eslint-config-standard": "^6.2.1",
37 43 "eslint-plugin-promise": "^3.4.0",
38 44 "eslint-plugin-standard": "^2.0.1",
39 45 "eventsource-polyfill": "^0.9.6",
... ... @@ -44,8 +50,7 @@
44 50 "function-bind": "^1.1.0",
45 51 "html-webpack-plugin": "^2.28.0",
46 52 "http-proxy-middleware": "^0.17.3",
47   - "webpack-bundle-analyzer": "^2.2.1",
48   - "cross-env": "^3.1.4",
  53 + "inject-loader": "^2.0.1",
49 54 "karma": "^1.4.1",
50 55 "karma-coverage": "^1.1.1",
51 56 "karma-mocha": "^1.3.0",
... ... @@ -56,26 +61,24 @@
56 61 "karma-webpack": "^2.0.2",
57 62 "lolex": "^1.5.2",
58 63 "mocha": "^3.2.0",
59   - "chai": "^3.5.0",
60   - "sinon": "^1.17.7",
61   - "sinon-chai": "^2.8.0",
62   - "inject-loader": "^2.0.1",
63   - "babel-plugin-istanbul": "^3.1.2",
64   - "phantomjs-prebuilt": "^2.1.14",
65   - "chromedriver": "^2.27.2",
66   - "cross-spawn": "^5.0.1",
67 64 "nightwatch": "^0.9.12",
68   - "selenium-server": "^3.0.1",
69   - "semver": "^5.3.0",
  65 + "node-sass": "^4.5.0",
70 66 "opn": "^4.0.2",
71 67 "optimize-css-assets-webpack-plugin": "^1.3.0",
72 68 "ora": "^1.1.0",
  69 + "phantomjs-prebuilt": "^2.1.14",
73 70 "rimraf": "^2.6.0",
  71 + "sass-loader": "^6.0.2",
  72 + "selenium-server": "^3.0.1",
  73 + "semver": "^5.3.0",
  74 + "sinon": "^1.17.7",
  75 + "sinon-chai": "^2.8.0",
74 76 "url-loader": "^0.5.7",
75 77 "vue-loader": "^11.0.0",
76 78 "vue-style-loader": "^2.0.0",
77 79 "vue-template-compiler": "^2.1.10",
78 80 "webpack": "^2.2.1",
  81 + "webpack-bundle-analyzer": "^2.2.1",
79 82 "webpack-dev-middleware": "^1.10.0",
80 83 "webpack-hot-middleware": "^2.16.1",
81 84 "webpack-merge": "^2.6.1"
... ...
src/App.vue
... ... @@ -11,13 +11,15 @@ export default {
11 11 }
12 12 </script>
13 13  
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   -}
  14 +<style lang="scss">
  15 + @import 'common/style/main';
  16 +
  17 + #app{
  18 + font-family: 'Avenir', Helvetica, Arial, sans-serif;
  19 + -webkit-font-smoothing: antialiased;
  20 + -moz-osx-font-smoothing: grayscale;
  21 + text-align: center;
  22 + color: #2c3e50;
  23 + margin-top: 60px;
  24 + }
23 25 </style>
... ...
src/common/style/main.scss 0 → 100644
  1 +h1{
  2 + color: red;
  3 +}
0 4 \ No newline at end of file
... ...
src/components/index.vue
... ... @@ -23,8 +23,9 @@ export default {
23 23 </script>
24 24  
25 25 <!-- Add "scoped" attribute to limit CSS to this component only -->
26   -<style scoped>
27   -h1, h2 {
28   - font-weight: normal;
29   -}
  26 +<style lang="scss" scoped>
  27 + h1{
  28 + font-size: 48px;
  29 + }
  30 +
30 31 </style>
... ...
src/components/layout/play_bar.vue
1 1 <template>
2 2 <div class="play-bar">
3 3 <h1>播放条</h1>
  4 + </div>
4 5 </template>
  6 +
  7 +<style lang="scss">
  8 + .play-bar{
  9 + h1{
  10 + color: red;
  11 + }
  12 + }
  13 +</style>
... ...