uni-app obtiene la fecha actual del sistema: 2020-07-01

Use new Date()el método para obtener la fecha de hoy en el sistema, y ​​el formato de visualización es: 2020-07-01

<template>
    <view class="content">
        {
   
   {date}}
    </view>
</template>
<script>
    export default {
        data() {
            return {
                date: new Date().toISOString().slice(0, 10),
            }
        },
        onLoad() {
        },
        methods: {}
    }
</script>
<style>
</style>
 

 

Supongo que te gusta

Origin blog.csdn.net/weixin_44285250/article/details/107062722
Recomendado
Clasificación