安装依赖
npm install --save chinese-lunar-calendar
vue 中引用
import { getLunar } from 'chinese-lunar-calendar'
mounted() {
const nowDate = getLunar(new Date().getFullYear(), new Date().getMonth() + 1, new Date().getDate())
console.log(nowDate )
},
dateStr: “二月廿五” //农历中文
isLeap: false //是否闰月
lunarDate: 25 //农历日期
lunarMonth: 2 //农历月份
lunarYear: “辛丑年” //农历年份,年以正月初一开始
solarTerm: null //节气,null代表没有
zodiac: “牛” //生肖,生肖以正月初一开始