js函数的es5和es6写法

es5 es6 js 函数 写法 编程技术
发布日期 2022-12-01 更新日期 2022-12-01 阅读次数 79 文章字数 180

以vue为例,es5更直观些,es6更简单些:

<script>

    var vm = new Vue({
        el: '#bodyContainer',
        data: {

        },
        methods:{
            
            es5 : function(){
                console.log(2);
            },
            
            es6(){
                console.log(1);
            }
        },
        mounted(){
            let query = getQuery();
            this.es5();
            this.es6();
        }
    });
</script>

文章作者: 朱丰华

文章链接: https://smart.52dixiaowo.com/blog/post-216.html

版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。

es5 es6 js 函数 写法

发表评论

相关推荐
朱丰华   |   2个月前   |   对象 · 属性 · 反射 · js

js 对象反射 Reflect

100    评论    点赞
朱丰华   |   1年前   |   页面 · 监听

iframe子父页面信息传递与监听

535    评论    点赞
朱丰华   |   1年前   |   < · iframe

让iframe嵌入的视频自适应 (100%宽度)?

205    评论    点赞
朱丰华   |   1年前   |   js · 重复

js如何避免重复监听addEventListener事件?

220    评论    点赞
朱丰华   |   1年前   |   html · id · <

html同一个页面有两个相同id ,如何用id选择器选中

160    评论    点赞
朱丰华   |   1年前   |   php

windows下编写、编译php扩展

221    评论    点赞
朱丰华   |   1年前   |   js · export · import

js es6 export,import,export default的用法和区别

169    评论    点赞
朱丰华   |   1年前   |   js · vue · 监听

js vue监听,深度监听

157    评论    点赞
朱丰华   |   1年前   |   vue · model

vue语法v-model原理与实现

161    评论    点赞
朱丰华   |   1年前   |   javascript · js · obfuscator · 混淆

javascript-obfuscator混淆js文件

89    评论    点赞
朱丰华   |   1年前   |   js · vue · npm · 安装

npm快速上手

161    评论    点赞
朱丰华   |   1年前   |   js · 模块 · nodejs

nodejs引入自定义模块

92    评论    点赞
朱丰华   |   1年前   |   nvm · git · 安装

entos7安装、使用nvm

121    评论    点赞
朱丰华   |   1年前   |   js · 滚动 · html

原生js实现顶部进度条效果

90    评论    点赞
朱丰华   |   1年前   |   python · linux · www

linux给www用户【非root】安装python3

288    评论    点赞
朱丰华   |   1年前   |   js · php · 字符 · 字符串

php json_encode对字符串转义用法

178    评论    点赞
朱丰华   |   1年前   |   sizeof · strlen

C语言里的sizeof()和strlen()关联和区别

167    评论    点赞
朱丰华   |   1年前   |   php

php扩展返回数字、布尔值的几种写法

113    评论    点赞
朱丰华   |   1年前   |   php · 返回 · 字符串

php内核zend引擎返回字符串的几种写法

98    评论    点赞
朱丰华   |   2年前   |   api

api接口的参数"原子"设计

118    评论    点赞
{{item.author_name}}   |   {{new Date(item.date*1000).log()}}   |   {{it}} ·

{{item.title}}

{{item.uv}}    评论    点赞