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>