tui.calender日历在vue中的安装与使用

本文介绍了在使用TUICalendarforVue时遇到的两个常见错误,包括Vue运行时编译器缺失和依赖冲突。提供了修复方法,包括配置Vue.config.js和解决依赖问题的步骤,以及如何集成和配置options参数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

官网:https://ui.toast.com/tui-calendar
github:https://github.com/nhn/tui.calendar/tree/main
月、周、日视图都有,拖拽也比较方便,但是自己用起来比较费劲,参考文档写得不全,做个记录日后方便参考,我用的vue。
在这里插入图片描述
1.首先搭建自己的项目,然后安装

npm install @toast-ui/calendar

安装可能遇到的报错以及解决方法

报错1:You are using the runtime-only build of Vue 
where the template compiler is not available. 
Either pre-compile the templates into render functions, 
or use the compiler-included build.

解决1:在根目录下新建一个新的vue.config.js的文件,
添加runtimeCompiler为true
module.exports = {
    runtimeCompiler: true
}


报错2:Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

解决2:重新安装,后面加上--legacy-peer-deps
npm install @toast-ui/calendar --legacy-peer-deps

  1. 在github上下载源码,然后找到vue-calender中的App.vue,把文件复制到自己项目的vue文件中,
    import的这些文件自己根据路径去项目中找到然后复制到自己的项目,不出意外就可以跑出来了。
    在这里插入图片描述

options选项里的字段
https://github.com/nhn/tui.calendar/tree/main/docs/en/apis
这些是options里面参数的介绍和日历的方法,可以挨个看看
在这里插入图片描述
介绍一部分
在这里插入图片描述
参考https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/calendar.md
在这里插入图片描述

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值