码迷,mamicode.com
首页 > 其他好文 > 详细

ES6 babel使用

时间:2020-02-22 10:20:54      阅读:77      评论:0      收藏:0      [点我收藏+]

标签:view   idt   name   lang   doctype   init   script   外链   rip   

ES6 babel使用

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="babel.min.js"></script>
</head>
<body>
<script type="text/babel">
let a = 0;
let b = 1;
let obj = {
    a,
    b,
    c(){
        console.log(2);
    }
};
let obj2 = {
    d:4,
    ...obj,
    e:5
};
console.log(obj2);
/* 
    使用教程:
    1.外链balel.min.js文件
    2.script type="text/babel"
*/
</script>
</body>
</html>

 

ES6 babel使用

标签:view   idt   name   lang   doctype   init   script   外链   rip   

原文地址:https://www.cnblogs.com/Afanadmin/p/12343954.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!