Closed X7md closed 2 years ago
https://cdn.jsdelivr.net/npm/lit-element@2.5.1/lit-element/+esm rendering: [object Object]
[object Object]
but https://unpkg.com/lit-element@2.5.1/lit-element.js?module work fine?
my code:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <date-hijri date="Sat May 15 2021 18:17:31 GMT+0300"></date-hijri> <script src='https://cdn.jsdelivr.net/npm/moment@2.29.1/moment.min.js'> </script> <script src='https://cdn.jsdelivr.net/npm/moment-hijri@2.1.2/moment-hijri.min.js'> </script> <script type='module'> import {html, LitElement} from 'https://unpkg.com/lit-element@2.5.1/lit-element.js?module'; export class DateHijri extends LitElement { static get properties() { return { date: {type: String} } } constructor() { super(); this.date = moment(); } render() { let date_hijri = moment(this.date).format('iYYYY/iM/iD'); return html`${date_hijri}هـ`; } } customElements.define('date-hijri', DateHijri); </script> </body> </html>
This issue applies to LitElement 2.x; the current version is now 3.x.
Please open a new issue if this is still occurring with the new version.
https://cdn.jsdelivr.net/npm/lit-element@2.5.1/lit-element/+esm rendering:
[object Object]
but https://unpkg.com/lit-element@2.5.1/lit-element.js?module work fine?
my code: