当前位置:网站首页>Méthodes couramment utilisées dans uniapp - TIMESTAMP et Rich Text Analysis picture
Méthodes couramment utilisées dans uniapp - TIMESTAMP et Rich Text Analysis picture
2022-06-10 15:30:00 【Poisson de bois dur】
Méthodes courantes
Obtenir l'horodatage actuel de la date
/** * Obtenir l'horodatage actuel */
function time() {
return Math.round(new Date() / 1000);
}
Chaîne à TIMESTAMP
/** * Chaîne à TIMESTAMP * @example: time:2022-01-12 12:00:00 */
function stringTotime(time) {
let time_sub= time.substring(0, 19);
time_sub= time_sub.replace(/-/g, "/");
return Math.round(new Date(time_sub).getTime() / 1000);
}
Image de résolution de texte riche ajouter un préfixe ou un suffixe(Utilisation courante et manipulationossTraitement des images)
// Détails
richTxt = richTxt.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, (match, p1) => {
return `<img src='${
this.imgUrl()+p1 + '/okh710auto'}' style="max-width:100%"/>`;
});
- Utilisation
.replace()(.La méthode est utilisée pour remplacer certains caractères par d'autres dans une chaîne,Ou remplacer une sous - chaîne qui correspond à une expression régulière.) - Voir la documentation https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/replace

边栏推荐
- Technology sharing | quick intercom, global intercom
- 【Rust日报】2022-04-19 Rust异步框架的性能评估
- 广和通携手中国移动、惠普、联发科、英特尔合作打造5G全互联PC泛终端系列产品
- Vins theory and code explanation 4 - initialization
- TensorFlow实战Google深度学习框架第二版学习总结-TensorFlow安装
- Net core Tianma XingKong series - Interface Implementation for dependency injection and mutual conversion of database tables and C entity classes
- 【奖励公示】【内容共创】第16期 五月絮升华,共创好时光!签约华为云小编,还可赢高达500元礼包!
- 微信小程序 颜色渐变
- 港大、英伟达 | Factuality Enhanced Language Models for Open-Ended Text Generation(用于开放式文本生成的事实性增强语言模型)
- Wechat applet slides to the top
猜你喜欢

反“内卷”,消息称 360 企业安全云将上线“一键强制下班”功能,电脑自动关闭办公软件

从“初代播种”到“落地生花”,广和通在5G商用三年间做了什么?

Digital management medium + low code, jnpf opens a new engine for enterprise digital transformation

VINS理论与代码详解0——理论基础白话篇

Yuntu says that every successful business system cannot be separated from apig

无线通信模组如何助力智能无人机打造“空中物联网”?

opencv神经网络库之SVM和ANN_MLP的使用

RSA a little bit of thought

2022 Nanjing International Smart site equipment exhibition

“绽放杯”5G应用奖项大满贯!广和通多个联合项目荣获通用产品专题赛一、二、三等奖
随机推荐
How the autorunner automated test tool creates a project -alltesting | Zezhong cloud test
ORB_ Slam2 visual inertial tight coupling positioning technology route and code explanation 3 - tight coupling optimization model
数据库创建触发器的问题
企业如何提升文档管理水平
The product design software figma cannot be used. What software with similar functions is available in China
虚拟机ping不通的几种原因及解决办法
Hutool Usage Summary (VIP collection version)
ORB_SLAM2视觉惯性紧耦合定位技术路线与代码详解1——IMU流型预积分
点击解锁广和通5G模组“关键词”
rk3399_9.0去掉设置的一级菜单network & internet
Vins theory and code explanation 0 -- theoretical basis in vernacular
云图说|每个成功的业务系统都离不开APIG的保驾护航
A complete multi-user wechat public platform development source code, with free sharing of documents
Kubernetes 1.24: preventing unauthorized volume mode switching
3. Encounter the form of handycontrol again
Kubernetes 1.24:statefulset introduces maxunavailable copies
初学pytorch踩坑
初识RPC
Using GDB to quickly read the kernel code of PostgreSQL
Opentelemetry metrics release candidate