700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > vue中获取当天农历(阴历)vue-chinese-lunar-calendar

vue中获取当天农历(阴历)vue-chinese-lunar-calendar

时间:2022-07-22 13:58:46

相关推荐

vue中获取当天农历(阴历)vue-chinese-lunar-calendar

1.安装chinese-lunar-calendar

npm install --save chinese-lunar-calendar

2.页面引用

<script>import {getLunar } from 'chinese-lunar-calendar'export default {data() {return {year: new Date().getFullYear(),month: new Date().getMonth() + 1,date: new Date().getDate()}},mounted() {// 获取农历console.log(getLunar(this.year, this.month, this.date))}}</script>

3.结果

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。