# test1 **Repository Path**: zhangyong_2020/test1 ## Basic Information - **Project Name**: test1 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-07-14 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # test1 ## 0.
,用css使div元素成为心形。 ![avatar](/img/heart.png) ## 1. 实现一组按钮的类,当添加类到其他按钮时,可以达到如下效果。鼠标移到按钮上时,颜色变淡。 ![avatar](/img/54F463AA-F96C-484f-8F2E-84E85F736EFA.png) ## 2. 再div1里添加一个表格,数据从list中来,样式差不多如下图。 ![avatar](/img/{8B1ACDAC-96F2-4450-AC4D-EA909612F91D}_20200731091909.jpg) ```
``` ## 3. 用js和css实现一个类似bootstrap模态框。 点击开始演示模态框按钮,弹出模态框。点击模态框上的关闭和确定按钮,关闭模态框。 ![avatar](https://www.runoob.com/wp-content/uploads/2014/07/modalpluginmethod_demo.jpg) ## 4. 去掉id重复的人,剩下的人名字以逗号拼接,结果为:小明,小张,小李,小孙 ``` let person = [ {id: 0, name: "小明"}, {id: 1, name: "小张"}, {id: 2, name: "小李"}, {id: 1, name: "小周"}, {id: 2, name: "小陈"}, {id: 3, name: "小孙"} ]; ``` ## 5. 写一个函数,将arr1转化成arr2。 ``` let arr1 = [ ['id', 'name', 'age'], [1, '张三', 18], [2, '李四', 20], [3, '王五', 25] ] let arr2 = [ { id: 1, name: '张三', age: 18 }, { id: 2, name: '李四', age: 20 }, { id: 3, name: '王五', age: 25 }, ] ``` ## 6. 写1个函数,将list转化为tree ,或tree转化为list ``` let list =[ {id:1,name:'浙江省',parentId:0}, {id:2,name:'江苏省',parentId:0}, {id:11,name:'杭州市',parentId:1}, {id:12,name:'宁波市',parentId:1}, {id:111,name:'余杭区',parentId:11}, {id:112,name:'西湖区',parentId:11}, {id:121,name:'海曙区',parentId:12}, {id:122,name:'北仑区',parentId:12}, {id:21,name:'南京市',parentId:2}, {id:22,name:'苏州市',parentId:2}, {id:211,name:'鼓楼区',parentId:21}, {id:212,name:'秦淮区',parentId:21}, {id:221,name:'姑苏区',parentId:22}, {id:222,name:'吴中区',parentId:22}, ] let tree=[{ "id": 1, "name": "浙江省", "children": [{ "id": 11, "name": "杭州市", "children": [{ "id": 111, "name": "余杭区", "children": [] }, { "id": 112, "name": "西湖区", "children": [] }] }, { "id": 12, "name": "宁波市", "children": [{ "id": 121, "name": "海曙区", "children": [] }, { "id": 122, "name": "北仑区", "children": [] }] }] }, { "id": 2, "name": "江苏省", "children": [{ "id": 21, "name": "南京市", "children": [{ "id": 211, "name": "鼓楼区", "children": [] }, { "id": 212, "name": "秦淮区", "children": [] }] }, { "id": 22, "name": "苏州市", "children": [{ "id": 221, "name": "姑苏区", "children": [] }, { "id": 222, "name": "吴中区", "children": [] }] }] }] ```