2

YML で HTML を使用しています [Object Object]

context:
      fieldLabel: |
                   <strong>
                       Some Bold Text
                   </strong> and now normal continued.

としてレンダリングしています

context:
fieldLabel: ",[object Object], and now normal continued.↵&quot;

しかし、私は自分の出力を

context: { fieldLabel: '<strong>\n    Some Bold Text\n</strong> and now normal continued.\n' },

私のJSコード:

const tests = YAML.safeLoad(this.props.children,{json:true});
console.log("tests",...tests)

コンソール出力:

context:
fieldLabel: ",[object Object], and now normal continued.↵&quot;

代わりに[オブジェクトオブジェクト]として来ています<strong>\n Some Bold Text\n</strong>

4

1 に答える 1