首页 > 解决方案 > 我想在客户端使用带有 CDN 的 datebook,但出现错误

问题描述

我正在尝试使用datebook CDN ( https://www.jsdelivr.com/package/npm/datebook ),但出现错误“未捕获的 ReferenceError:ICalendar 未定义”。

有人能帮助我吗?

我的代码:

<script src="https://cdn.jsdelivr.net/npm/datebook@6.5.3/dist/datebook.min.js"> </script>
<script>
    const config = {
       title: "hello",
       location: 'The Bar, New York, NY',
       description: 'Let\'s blow off some steam with a tall cold one!',
       start: new Date('2022-07-08T19:00:00'),
       end: new Date('2022-07-08T23:30:00'),
    }

    const icalendar = new ICalendar(config)
    console.log(icalendar.render());
  </script>

标签: javascriptcdnclient-side

解决方案


推荐阅读