You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shop-pc/pages/index/index.vue

50 lines
976 B

3 years ago
<!--
* @Author: ch
* @Date: 2022-05-03 22:14:16
* @LastEditors: ch
* @LastEditTime: 2022-05-04 22:21:04
* @Description: file content
-->
<template>
<div>
<h1>我是首页</h1>
<Banner />
<Seckil />
<div>时间格式化方法测试{{date}}</div>
<a href="/order/list">去订单</a>
<button @click="login"></button>
</div>
</template>
<script>
import { ApiGetGoodsList } from "~/plugins/api/goods";
import { FormatDate } from "~/plugins/utils";
import Banner from "./module/Banner.vue";
import Seckil from "./module/Seckill.vue";
export default {
components: { Banner, Seckil },
data(){
return {
date : '时间'
}
},
asyncData({ $axios }) {
ApiGetGoodsList().then((res) => {
console.log(res);
});
},
mounted() {
this.date = FormatDate(new Date() , 'yyyy年MM月dd日');
// setInterval(()=>{
// location.reload();
// },50000)
},
methods: {
login() {
this.$store.commit("SET_TOKEN", "123");
},
},
};
</script>