- 获取当前月份
getCurrentMonth () {
let date = new Date()
let year = date.getFullYear()
let month = date.getMonth() + 1
month = (month < 10 ? '0' + month : month)
this.period = (year.toString() + month.toString())
}
- 根据环境动态加载js包
<script>
mounted () {
let head = document.getElementsByTagName('head')[0]
let script = document.createElement('script')
script.type = 'text/javascript'
script.src = `${process.env.NODE_ENV === 'development' ? 'https://fhms-di1.sit.cmft.com' : window.location.origin}/web-apps/apps/api/documents/api.js`
head.appendChild(script)
}
</script>
- 全局滚动条样式优化
::-webkit-scrollbar {
width: 10px;
height: 10px;
background-color: rgba(0, 0, 0, .2);
}
::-webkit-scrollbar-track {
border-radius: 5px;
background-color: rgba(216, 216, 216, .9);
}
::-webkit-scrollbar-thumb {
border-radius: 5px;
background-color: rgba(0, 0, 0, .2);
}