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

    技术2022-07-11  108

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

     

    Processed: 0.008, SQL: 9