APIs

APIs are public methods that can be used to call components within JavaScript code. SPZ.whenApiDefined is used to get the API of a component.

API Usage

<spz-render layout="container" id="render">
  <!-- ... -->
</spz-render>

<spz-script layout="logic" type="application/javascript">
  const render = document.getElementById('render');
  SPZ.whenApiDefined(render).then((apis) => {
    apis.render(data='Test data');
    // ...
  });
</spz-script>

spz-render

APIDescriptionType
renderRe-renders the element. The redo option is optional and specifies whether to unload the content from the previous rendering first.(data, redo) => Promise
getDataGets the data that has been rendered.() => Object | Array

spz-list

APIDescriptionType
refreshRe-renders the element. The redo option is optional and specifies whether to reset the properties from the previous rendering first.(options, redo) => Promise
getDataGets the data that has been rendered.() => Array

AI Usage Notes (LLM Ready)

  • Section density: detected 3 level-2 headings.
  • Example density: detected 1 code blocks.
  • Read conclusions first: extract definitions, constraints, and boundary conditions.
  • Then verify with examples: rely on executable snippets rather than prose only.
  • Finally cross-check: open related component pages to avoid doc/runtime drift.