The l-painter component supports two ways to draw posters: using specialized HTML components or a JSON schema.
1. HTML Method
Use the following components within <l-painter>:
<l-painter-view>: A container similar to a div that can nest other components.<l-painter-text>: For rendering text.<l-painter-image>: For rendering images.<l-painter-qrcode>: For rendering QR codes.
Note: Instead of the standard style attribute, use the css attribute to define styles (e.g., css="background: #000; height: 100rpx;").
2. JSON Schema Method
Pass a JSON object to the :board prop. In the JSON schema:
- Component types are defined by the
type field: view, text, image, or qrcode. - Styles are defined in a
css object using camelCase keys (e.g., lineHeight instead of line-height). - Nested elements are placed in a
views array within a view type object.