js import环境搭建等

首先 npm init

npm install babel-cli -g

npm install babel-preset-stage-0 --save-dev

npm install --save-dev babel-preset-es2015

然后新建一个 .babelrc 文件(用编辑器创建),写入:

{
  presets: ['es2015']
}
//a.js
var sex="boy";
var echo=function(value){
  console.log(value)
}
export {sex,echo}  


//b.js
import {sex,echo} from "./a.js" 
console.log(sex)   // boy
echo(sex) // boy

babel ./b.js  --out-file ./out_b.js

然后就可以运行了

babel-node out_b.js

 

http://blog.csdn.net/rongxiang111/article/details/78117125

 

vue组件化基础  属性仅仅在这个组件里使用--- to thi tha

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

 

posted @ 2018-02-22 18:49  cnchengv  阅读(137)  评论(0)    收藏  举报