• 请不要在回答技术问题时复制粘贴 AI 生成的内容
firhome
V2EX  ›  程序员

有使用过 protobufjs 的大佬吗,请教嵌套的类怎么 create 阿?

  •  
  •   firhome · Jun 28, 2022 · 1169 views
    This topic created in 1451 days ago, the information mentioned may be changed or developed.
    我的 proto 文件类

    txt {
    string title = 'title'
    }

    我用的 protobufjs ,txt.create({ title:'xxxx'}) 没有问题


    但是如果里面还嵌套别的类的话不知道怎么做了

    如:

    book {
    string title;

    infoModel info;
    }

    就不知道怎么 create 里面的 infoModel 并挂到 book 上去
    Supplement 1  ·  Jun 28, 2022
    自己搞定了,代码写错了。 忽略~~~~ 感谢各位大佬
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2614 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 14:49 · PVG 22:49 · LAX 07:49 · JFK 10:49
    ♥ Do have faith in what you're doing.