摘要: console.log(arr) console.log(JSON.stringify(arr)) console.log(JSON.parse(JSON.stringify(arr))) 阅读全文
posted @ 2020-08-25 17:37 hello芳芳 阅读(133) 评论(0) 推荐(0)
摘要: // 注册一个全局自定义指令 `v-focus` Vue.directive('focus', { // 当被绑定的元素插入到 DOM 中时…… inserted: function (el) { // 聚焦元素 el.focus() } }) 如果想注册局部指令,组件中也接受一个 directiv 阅读全文
posted @ 2020-08-25 15:36 hello芳芳 阅读(222) 评论(0) 推荐(0)
摘要: // 生产环境阻止鼠标右键 Vue.directive('preventright', { bind: function(el, binding, vnode) { if (process.env.NODE_ENV !== 'development') { el.oncontextmenu = fu 阅读全文
posted @ 2020-08-25 14:13 hello芳芳 阅读(1536) 评论(0) 推荐(0)
摘要: <script> let arr=[ {id:1,name:"aaa",age:12}, {id:2,name:"bbb",age:20}, {id:3,name:"ccc",age:5}, {id:4,name:"ddd",age:18} ] function sortKey(array,key) 阅读全文
posted @ 2020-08-25 08:54 hello芳芳 阅读(345) 评论(0) 推荐(0)