会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Mr_R
博客园
首页
新随笔
联系
管理
订阅
09 2018 档案
上传视频本地预览问题
摘要:var file = document.getElementById('file').files[0]; var url = URL.createObjectURL(file); console.log(url); document.getElementById("audio_id").src =
阅读全文
posted @
2018-09-26 17:48
Mr_R
阅读(218)
评论(0)
推荐(0)
vue 监听store中的数值
摘要:computed: { isFollow () { return this.$store.state.demo.id; //需要监听的数据 } }, watch: { isFollow (newVal, oldVal) { //do something } }, computed: { isFoll
阅读全文
posted @
2018-09-20 14:30
Mr_R
阅读(7098)
评论(0)
推荐(0)
判断对象是否为空
摘要:1. 最常见的思路,for...in...遍历属性,为真则为“非空数组”;否则为“空数组” 2.通过JSON自带的.stringify方法判断(上传数据常用) 3.当然就是ES6的语法啦,Object.key(); Object.keys方法是JavaScript中用于遍历对象属性的一个方法 。 它
阅读全文
posted @
2018-09-20 14:22
Mr_R
阅读(372)
评论(0)
推荐(0)
正则 验证是否包含特殊字符
摘要:validate: function(value) { var pattern = /[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im; if (value '' || value null) return false; if (pattern.test(value)) { r
阅读全文
posted @
2018-09-10 13:57
Mr_R
阅读(4630)
评论(0)
推荐(1)
js 过滤日期格式
摘要:Date.prototype.Format = function (fmt) { //author: meizz var o = { "M+": this.getMonth() + 1, //月份 "d+": this.getDate(), //日 "h+": this.getHours(), //
阅读全文
posted @
2018-09-10 13:46
Mr_R
阅读(1189)
评论(0)
推荐(0)
vue methods computed watch区别
摘要:一.methods和computed computed是计算属性,methods是方法。 html: <p>Reversed message: "{{ reversedMessage() }}"</p> js: 1. var vm = new Vue({ el: '#example', data:
阅读全文
posted @
2018-09-05 14:49
Mr_R
阅读(175)
评论(0)
推荐(0)
公告