Table of contents
Mount.js event plugin
beginTime: moment().startOf('year').valueOf(),
endTime: moment().endOf('year').valueOf(),
beginTime: moment().hour(0).minute(0).second(0).valueOf(),
endTime: moment().add(1, 'days').hour(0).minute(0).second(0).valueOf(),
moment().year(moment().year()).startOf('year') 获取指定年份的开始时间
moment().set('year',2020)
curYear: moment().format('YYYY'),
yearStartTime: moment(moment().year() + '-01-01 00:00:00').valueOf(),
yearEndTime: moment().valueOf(),
年的第一天和最后一天时间
beginTime:global.moment().set('year',2021).startOf('year').valueOf(),
endTime:global.moment().set('year',2021).add(1, 'year').startOf('year').subtract(1,"day").valueOf()
dayjs
dayjs().year(2022).valueOf() // 设置年份
dayjs().toDate() // 返回Date类型
Set to Chinese type, week is Chinese week (that is, Monday is the beginning of the week)
import 'dayjs/locale/zh-cn'; // 设置周的周一为一周的开始
import dayjs from 'dayjs';
dayjs.locale('zh-cn');
echartsLayer.js
echart event listener plugin
pdfjs-ts/dist
Install:
npm i pdfjs-ts
Preparation:
Find the pdfjs-ts folder in the dependent file and copy the two files in it to the working directory
Page import:
import {
PDFTS } from 'pdfjs-ts/dist'
code:
const dom = document.querySelector('#containers')
if(!dom) return
let child = dom.lastElementChild
while (child) {
// 清除dom节点的子元素
dom.removeChild(child)
child = dom.lastElementChild
}
data.pdf = new PDFTS({
url: Config.fileServer+id, // pdf文件地址
container: dom,
workerURL: '/src/assets/pdfjs/pdf.worker.min.js', // 存放的位置
multiple: true // 显示全部页
});
data.pdf.initial().then(()=> {
data.pdf.renderer.render()
});
QR code: qrcode.js
<script type="text/javascript"
src="/cas/js/jquery.qrcode.js"></script>
<script type="text/javascript" src="/cas/js/qrcode.js"></script>
<script type="text/javascript" src="/cas/js/jquery-1.9.1.min.js"
></script>
<div id="zzt-code-box"></div>
$('#zzt-code-box').qrcode({
//这种方式兼容IE8
render: "table",
width: 167,
height: 167,
correctLevel : 1,
text: "https://puser.zjzwfw.gov.cn/sso/mobile.do"
});
perfect-scrollbar
Roller assembly
pandoc
Word and md files can be converted to each other
Enter the corresponding directory and run the corresponding code:
pandoc -f docx -t markdown -o output.md 关于Vite打包问题的解决方案.docx
Explanation:
-f sets the format of the source file;
-t sets the format of the exported file;
-s means to create a "stand-alone" file;
-o sets the file to be exported.