网站如何规范的排版编辑,开网站做商城怎么样,google网站提交,ps切片怎么做网站1、使用场景 如图#xff1a;消息提示框中#xff0c;将数据中的数据单独一行显示 2、代码 let errorList res.result; //后端返回的数据例#xff1a; [1. 数据格式不正确,2. 数据已存在]if(errorListerrorList.length!0){this.$notif…1、使用场景 如图消息提示框中将数据中的数据单独一行显示 2、代码 let errorList res.result; //后端返回的数据例 [1. 数据格式不正确,2. 数据已存在]if(errorListerrorList.length!0){this.$notification.open({message: 数据有误,duration:0, //取消定时关闭效果description: h{let arr [];errorList.forEach((item){arr.push(h(p,null,item)) })return h(div,null,arr)}})}3、h函数使用vue2x h(标签元素,标签属性,标签下的子元素)
一、attrs设置html属性例如id
1、h(div,{id:divObj},hello world)div iddivObjhello world/div2、h(div,null,hello word)divhello world/div
3、h(div,null,[h(span,null,1.张三),h(span,null,2.李四)]divspan1.张三/spanspan2.李四/span
/div二、props设置DOM节点例如value
1、h(input,{type:text,value:hello},null)input typetext valuehello/三、classDOM类名
1、h(div,{class:iconCss},hello)div classiconCsshello/div四、style
1、h(div,{style:color:red},hello)div stylecolor:redhello/div