Skip to content

Make it possible to pass complex properties (objects, arrays) to element #94

Open
@blikblum

Description

@blikblum

Hi, just tried api-viewer but could not get how to pass an array to an element

The element, written in lit expects a property to be passed as array. It does not reflect to attribute.

I tried using lit-html as below without success:

import 'api-viewer-element'
import '../browserAction/patient-list.js'
import { html, render } from '../third-party/lit.js'

const patients = [{ name: 'João' }, { name: 'Maria' }]

const apiTemplate = html`
  <api-viewer src="../custom-elements.json">
    <template data-element="patient-list" data-target="host">
      <patient-list .patients=${patients}></patient-list>
    </template>
  </api-viewer>
`
render(apiTemplate, document.body)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions