js日期格式相关
一般的格式化12345//年-月-日 时:分:秒 const dateFormatter = (e)=> { return `${e.getFullYear()}-${e.getMonth() + 1 < 10? "0" + (e.getMonth() + 1): e.getMonth() + 1 }-${e.getDate() < 10 ? "0" + e.getDate() : e.getDate()} ${e.getHours() < 10 ? "0" + e.getHours() : e.getHours()}:${e.getMinutes() < 10 ? "0" + e.getMinutes() : e.getMinutes()}`;}
判断时间差是否在范围内123456const isWithinSomeHours = (timestamp ...
仿CSDN实现添加可自定义标签
效果图
123456789101112131415161718192021222324252627<view class="weui-cell weui-cell_active"> <view class="weui-cell__hd"><label class="weui-label">擅长领域</label></view> <view class="weui-cell__bd"> <view class="tagContainer"> <view class="tag-item" v-bind:key="index" v-for="(tagText,index) in tagList"> <text :data-text="tagText">{{tagT ...
css 在div左上角添加类似书签的标记
效果图
html123<view class="mark corner-o" > 半导体</view>
CSS123456789101112131415161718192021222324252627.mark { float: left; margin: 0 6rpx; position: relative; padding: 0; width: 24px; color: #fff; writing-mode: sideways-rl; text-align: center; } .mark::after { position: absolute; content: ""; left: 0; top: 100%; border-style: solid; border-width: 0 12px 12px 12px; } .mark.corner-o { background: #ffaa00; } .mark.corner- ...