企业网站开发价,秦皇岛建设网站公司,怎么做网络广告推广,自助手机建站系统在 vue3 项目开发中#xff0c;引入 dayjs 插件后#xff0c;使用 isoWeek() 浏览器提示错误#xff1a;
Uncaught (in promise) TypeError: x.isoWeek is not a function 解决方案 要想使用 isoWeek() API#xff0c;就需要引入插件扩展包#xff08;dayjs/plugin/isoWe…
在 vue3 项目开发中引入 dayjs 插件后使用 isoWeek() 浏览器提示错误
Uncaught (in promise) TypeError: x.isoWeek is not a function 解决方案 要想使用 isoWeek() API就需要引入插件扩展包dayjs/plugin/isoWeek如下代码引入使用所示 // 引入基础包
import dayjs from dayjs// 引入并初始化 周处理 的扩展包
import isoWeek from dayjs/plugin/isoWeek
dayjs.extend(isoWeek)const today dayjs();
const currentWeekNumber today.isoWeek();
console.log(Current week number (ISO): ${currentWeekNumber});