logo
  • 教程列表
  • SO官方文档
  • Json.Decode
    • 预解码字段并根据解码的值解码其余字段
    • 解码列表
    • 解码记录列表
    • 解析 Rust 枚举中的 JSON
    • 解码日期
    • 解码包含对象列表的对象列表
  1. StackOverflow 文档
  2. Elm Language 教程
  3. Json.Decode
  4. 解码列表

解码列表

Created: November-22, 2018

可以在 https://ellie-app.com/m9tk39VpQg/0 上测试以下示例。

import Html exposing (..)
import Json.Decode 

payload =
  """
  ["fu", "bar"]
  """

main =
  Json.Decode.decodeString decoder payload -- Ok ["fu","bar"]
  |> toString
  |> text

decoder =
  Json.Decode.list Json.Decode.string
  • 解码记录列表
  • 预解码字段并根据解码的值解码其余字段

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明