var ItemComponent = {
  importCss:function(){
    var link = document.createElement("link")
    link.setAttribute("rel","stylesheet")
    link.setAttribute("href","./components/item/index.css")
    document.head.appendChild(link)
  },
  createDom:function(props){
    var root = document.createElement("div")
    root.onclick = props.emit
    root.className = "item"
    if (props.item.isChange) {
      root.classList.add("change")
    }
    
    var p = document.createElement("p")
    p.innerText = props.item.text
    root.appendChild(p)

    var p = document.createElement("p")
    p.className = "delete"
    p.innerText = "delete"
    p.onclick = props.delete
    root.appendChild(p)
    
    return root
  }
}
ItemComponent.importCss()