1

假设我希望 each<tr>成为一个对象,其子<td>项成为该对象的字段。所以我正在寻找这样的东西:

getListFromTable :: Window -> Element -> [Thing]
getListFromTable w table = do
  rows <- getElementsByClassName w "thing-row"
  -- BS starts here, lets say fromFields creates a Thing from ... fields.
  attrList = [ fromFields [ r # get UI.children ] | r <- rows ]
  return attrList  

但是,我似乎无法正确选择类型,而且我想我什至不知道什么get UI.children是正确的,因为它不像给我一个像 [Element] 这样的明显类型。

4

1 回答 1

1

作为类型

children :: WriteAttr Element [Element]

表示,该属性是只写的。从threepenny-gui 0.6 版开始,不可能获得特定元素的所有子元素的列表。

于 2015-12-05T21:14:31.147 回答