[
  {
    "path": ".babelrc",
    "content": "{\n    presets: ['es2015', 'stage-0']\n}"
  },
  {
    "path": ".gitignore",
    "content": "#log\n*.log\n\n#npm\nnode_modules\n\n#build\ndist"
  },
  {
    "path": "README.md",
    "content": "# vue2\n\n> A Vue.js project\n\n## Build Setup\n\n``` bash\n# install dependencies\nnpm install\n\n# serve with hot reload at localhost:8080\nnpm run dev\n\n# build for production with minification\nnpm run build\n```\n\nFor detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).\n"
  },
  {
    "path": "index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <title>vue2</title>\n    <script src=\"https://cdn.jsdelivr.net/vue.resource/1.0.3/vue-resource.min.js\"></script>\n  </head>\n  <body>\n    <div id=\"app\"></div>\n    <script src=\"dist/build.js\"></script>\n\n  </body>\n</html>\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"vue2\",\n  \"description\": \"A Vue.js project\",\n  \"author\": \"\",\n  \"private\": true,\n  \"scripts\": {\n    \"dev\": \"webpack-dev-server --open --inline --hot\",\n    \"build\": \"cross-env NODE_ENV=production webpack --progress --hide-modules\"\n  },\n  \"dependencies\": {\n    \"element-ui\": \"^1.0.0-rc.5\",\n    \"vue\": \"^2.0.1\",\n    \"vue-resource\": \"^1.0.3\",\n    \"vue-router\": \"^2.0.0\",\n    \"webpack-dev-server\": \"^2.9.3\"\n  },\n  \"devDependencies\": {\n    \"babel-core\": \"^6.0.0\",\n    \"babel-loader\": \"^6.0.0\",\n    \"babel-preset-es2015\": \"^6.16.0\",\n    \"babel-preset-stage-0\": \"^6.16.0\",\n    \"cross-env\": \"^3.0.0\",\n    \"css-loader\": \"^0.25.0\",\n    \"file-loader\": \"^0.9.0\",\n    \"style-loader\": \"^0.13.1\",\n    \"vue-loader\": \"^9.5.1\",\n    \"webpack\": \"^2.7.0\"\n  }\n}\n"
  },
  {
    "path": "src/App.vue",
    "content": "<template>\n  <div id=\"app2\">\n    <img src=\"./assets/logo.png\">\n    <h1>Hello App!</h1>\n    <firstcomponent></firstcomponent>\n    <ul>\n        <li><router-link to=\"/first\">点我跳转到第一页</router-link></li>\n        <li><router-link to=\"/second\">点我跳转到第二页</router-link></li>\n      </ul>\n    <router-view class=\"view\"></router-view>\n  </div>\n</template>\n\n<script>\nimport firstcomponent from './component/firstcomponent.vue'\nexport default {\n  data () {\n    return {\n      msg: 'Hello Vue!'\n    }\n  },\n  components: { firstcomponent }\n}\n\n\n</script>\n\n<style>\nbody {\n  font-family: Helvetica, sans-serif;\n}\n</style>\n"
  },
  {
    "path": "src/component/firstcomponent.vue",
    "content": "<template>\n  <div id=\"firstcomponent\">\n    <h1>I am a component.</h1>\n    <a> written by {{ author }} </a>\n  </div>\n</template>\n\n<script type=\"text/javascript\">\nexport default {\n  data () {\n    return {\n      author: \"Jinkey\"\n    }\n  }\n}\n</script>\n\n<style>\n\n</style>\n"
  },
  {
    "path": "src/component/secondcomponent.vue",
    "content": "<template>\n  <div id=\"secondcomponent\">\n    <h1>I am another page</h1>\n    <el-card class=\"box-card\">\n      <div slot=\"header\" class=\"clearfix\">\n        <h1 style=\"line-height: 36px; color: #20A0FF\">豆瓣电影排行榜</h1>\n      </div>\n      <div v-for=\"article in articles\" class=\"text item\">\n        {{article.title}}\n      </div>\n    </el-card>\n\n    <a> written by {{ author }} </a>\n    <p> 感谢 <a href=\"https://github.com/showonne\">showonne</a>大神的技术指导</p>\n  </div>\n</template>\n\n<script>\nexport default {\n  data() {\n    return {\n      author: \"微信公众号 jinkey-love\",\n      articles: [],\n    }\n  },\n  mounted: function() {\n    this.$http.jsonp('https://api.douban.com/v2/movie/top250?count=10', {}, {\n        headers: {\n\n        },\n        emulateJSON: true\n    }).then(function(response) {\n      // 这里是处理正确的回调\n\n        this.articles = response.data.subjects\n        // this.articles = response.data[\"subjects\"] 也可以\n\n    }, function(response) {\n        // 这里是处理错误的回调\n        console.log(response)\n    });\n  }\n}\n</script>\n\n<style>\n\n</style>\n"
  },
  {
    "path": "src/main.js",
    "content": "import Vue from 'vue'\nimport App from './App.vue'\nimport VueRouter from \"vue-router\";\nimport VueResource from 'vue-resource'\nimport Element from 'element-ui'\nimport 'element-ui/lib/theme-default/index.css'\n\nVue.use(Element)\n\n//开启debug模式\nVue.config.debug = true;\n\nVue.use(VueRouter);\nVue.use(VueResource);\n\n\n// 定义组件, 也可以像教程之前教的方法从别的文件引入\nconst First = { template: '<div><h2>我是第 1 个子页面</h2></div>' }\nimport secondcomponent from './component/secondcomponent.vue'\n\n\n\n// 创建一个路由器实例\n// 并且配置路由规则\nconst router = new VueRouter({\n  mode: 'history',\n  base: __dirname,\n  routes: [\n    {\n      path: '/first',\n      component: First\n    },\n    {\n      path: '/second',\n      component: secondcomponent\n    }\n  ]\n})\n\n\n\n// 现在我们可以启动应用了！\n// 路由器会创建一个 App 实例，并且挂载到选择符 #app 匹配的元素上。\nconst app = new Vue({\n  router: router,\n  render: h => h(App)\n  // components: { firstcomponent, secondcomponent }\n}).$mount('#app')\n"
  },
  {
    "path": "webpack.config.js",
    "content": "var path = require('path')\nvar webpack = require('webpack')\n\nmodule.exports = {\n  entry: './src/main.js',\n  output: {\n    path: path.resolve(__dirname, './dist'),\n    publicPath: '/dist/',\n    filename: 'build.js'\n  },\n  resolve: {\n    alias: {vue: 'vue/dist/vue.js'}\n  },\n  module: {\n    loaders: [\n      {\n        test: /\\.vue$/,\n        loader: 'vue-loader'\n      },\n      {\n        test: /\\.js$/,\n        loader: 'babel-loader',\n        exclude: /node_modules/\n      },\n      {\n          test: /\\.css$/,\n          loader: \"style-loader!css-loader\"\n      },\n      {\n        test: /\\.(eot|woff|woff2|ttf)([\\?]?.*)$/,\n        loader: \"file-loader\"\n      },\n      {\n        test: /\\.(png|jpg|gif|svg)$/,\n        loader: 'file-loader',\n        query: {\n          name: '[name].[ext]?[hash]'\n        }\n      }\n    ]\n  },\n  devServer: {\n    historyApiFallback: true,\n    noInfo: true\n  },\n  devtool: '#eval-source-map'\n}\n\nif (process.env.NODE_ENV === 'production') {\n  module.exports.devtool = '#source-map'\n  // http://vue-loader.vuejs.org/en/workflow/production.html\n  module.exports.plugins = (module.exports.plugins || []).concat([\n    new webpack.DefinePlugin({\n      'process.env': {\n        NODE_ENV: '\"production\"'\n      }\n    }),\n    new webpack.optimize.UglifyJsPlugin({\n      compress: {\n        warnings: false\n      }\n    })\n  ])\n}\n"
  }
]