摘要: 父组件代码如下: <template> <div> 我是父组件: <input type="text" v-model="msg"> <son-box v-model="msg"/> </div> </template> <script> // 导入子组件 import SonBox from '@ 阅读全文
posted @ 2022-12-06 22:29 MetX 阅读(50) 评论(0) 推荐(0) 编辑
摘要: html{ -webkit-filter: grayscale(100%); -moz-filter:grayscale(100%); -ms-filter: grayscale(100%); -mo-filter:grayscale(100%); filter:grayscale(100%); f 阅读全文
posted @ 2022-12-03 19:56 MetX 阅读(434) 评论(0) 推荐(0) 编辑
摘要: // 移除数组arr中的所有值与item相等的元素,直接给定的arr数组上进行操作,并将结果返回输入 function removeWithoutCopy(arr,item){ for(let i = 0;i<arr.length;i++){ if(arr[i] item){ arr.splice( 阅读全文
posted @ 2022-12-03 18:34 MetX 阅读(43) 评论(0) 推荐(0) 编辑
摘要: //返回数组的格式为key:value的形式不打印原型上的属性 var C = function(){ this.foo='bar' this.baz = 'bim' } C.prototype.bop ='bip' iterate(new C()) function iterate(obj){ c 阅读全文
posted @ 2022-12-03 18:16 MetX 阅读(9) 评论(0) 推荐(0) 编辑
摘要: socket.io在node中使用,首先安装express,socket.io,为了方便起见还安装了nodemon,它可以帮我们快速启动js文件,配置如下: 效果展示如下: 阅读全文
posted @ 2022-12-03 02:04 MetX 阅读(63) 评论(0) 推荐(0) 编辑
摘要: // 创建ws实例,建立连接(ws://121.40.165.18.8800 有广告) var ws = new WebSocket('wss://javascript.info/article/websocket/demo/hello') // 连接成功事件 ws.onopen = functio 阅读全文
posted @ 2022-12-02 19:18 MetX 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-12-02 18:39 MetX 阅读(12) 评论(0) 推荐(0) 编辑