uni-app获取当前系统年月日:2020-07-01

使用new Date()方法获取系统今天的日期,显示格式为: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>
 

猜你喜欢

转载自blog.csdn.net/weixin_44285250/article/details/107062722