摘要: 这一步没有封装 是为了 自己能更好的理解 封住组价 的意义 了解 组件之间的关系 这段代码 运行的结果 也会给出下列 gif图 第二步 点击当前水果 ,把水果的名字 输出到--> div后面 这时候 用个变量 去接收 插值{{}} 第三步 开始思考 封装 概念 其实这个li标签 应该被封装 阅读全文
posted @ 2022-05-20 01:41 NIEandyou 阅读(36) 评论(0) 推荐(0)
摘要: <title>发布微博小案例</title> </head> <body> <textarea class="publish"></textarea> <button>发布</button> <ul></ul> <script> //1.获取发布按钮的dom元素 const but=document 阅读全文
posted @ 2022-04-12 01:12 NIEandyou 阅读(50) 评论(0) 推荐(0)
摘要: <body> <script> //给body标签绑定键盘按下事件 keydown document.body.addEventListener('keydown',function(event){ console.log(event); //当下按下的案件 }) </script> </body> 阅读全文
posted @ 2022-04-12 00:22 NIEandyou 阅读(22) 评论(0) 推荐(0)
摘要: <style> div{ width: 300px; height: 400px; background-color: aqua; margin-left: 300px; } </style> </head> <body> <div>点击点击</div> <script> // 获取按钮 const 阅读全文
posted @ 2022-04-12 00:15 NIEandyou 阅读(18) 评论(0) 推荐(0)
摘要: <button>点击</button> <script> //获取button标签的dom元素 const but=document.querySelector('button') //绑定鼠标点击事件 but.addEventListener('click',function(event){ co 阅读全文
posted @ 2022-04-12 00:13 NIEandyou 阅读(16) 评论(0) 推荐(0)
摘要: <script> let name='猪猪' name='狗狗' console.log(name); const name1='猪猪' name1='狗狗' console.log(name1); /* 总结: 1.const和let一样 也能声明变量 2.const声明变量不能被修改 let 可 阅读全文
posted @ 2022-04-12 00:12 NIEandyou 阅读(24) 评论(0) 推荐(0)