使用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>