2017-08-30 26 views
2

是否有一種方法可以將元素的屬性值(特別是id)作爲字符串獲取? 例如以下行導致 「()」:Threepenny-GUI:獲取字符串的屬性值

field <- UI.new 
    # set (attr "id") "some text" 


on UI.drop field $ \_ -> do 

    -- Some label to print the attribute value to 
    label <- getElementById window "labelID" 

    id <- get (attr "id") field 
    (element (fromJust label)) # set text (show id) 

由於attr返回WriteAttrget可能無法工作。有沒有解決方法?

提前致謝!

問候

回答

0

正如三毛錢桂v0.8.1.0的,這是目前尚未實現。這當然是可能的,我還沒有到處去做。隨意在Github上打開一個問題!

(請注意,您可以隨時與runFunctionffi功能直接調用JavaScript如果你缺少的功能。)