vue-cli 注意事项

2017-04-20  本文已影响0人  郝小淞

安装

# 全局安装 vue-cli
$ npm install --global vue-cli
# 创建一个基于 webpack 模板的新项目
$ vue init webpack my-project
# 安装依赖,走你
$ cd my-project
$ npm install
$ npm run dev

vue-cli使用scss

$ npm install node-sass --save-dev
$ npm install sass-loader --save-dev

vue-cli模板

<template>
</template>

<script type="text/babel">
export default {
  name: 'hello',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App'
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss" rel="stylesheet/scss">
</style>

vue 生命周期

一篇比较好的vue 生命周期介绍[https://segmentfault.com/a/1190000008010666]

新版本的Vue-cli 模拟数据数据的处理方式

[http://www.xiuyuan.info/?p=230 ]
[https://segmentfault.com/q/1010000011988039/ ]

上一篇 下一篇

猜你喜欢

热点阅读