ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
接口图 ![](https://img.kancloud.cn/88/96/8896885727e45520c7ee739ecdedf9b7_856x720.png) 获取数据 ~~~ <script> export default { data() { return { //查询参数对象 queryInfo:{ query: ' ' , pagenum:1, pagesize: 10 }, //商品列表 goodslist:[], //总数据条数 total: 0 } }, created() { this.getGoodsL ist() }, methods: { //根据分页获取对应的商品列表 async getGoodsList() { const { data: res } = await this.$http.get('goods', { params: this.queryInfo }) if (res.meta.status !== 200) { return this . $message . error( '获取商品列表失败! ') } this.$message.success( '获取商品列表成功! ') console.log(res.data ) this. goodslist = res .data. goods this. total = res.data. total } } } </script> ~~~ ![](https://img.kancloud.cn/ea/f6/eaf6d02ccfc976808792c0abd490aa78_549x1154.png) # 时间格式化/格式化时间 ![](https://img.kancloud.cn/db/5e/db5e2d6a1952beab18e5c78c60941cac_1017x478.png) ~~~ 全局作用域下书写 main.js 文件下 书写 Vue.filter( ' dateFormat', function(originVal) { const dt = new Date(originVal) const y = dt . getFullYear() const m = (dt . getMonth() + 1 + ''). padStart(2, '0') const d = (dt.getDate() + "').padStart(2, '0') const hh = (dt. getHours() + '). padstart(2, '0' ) const mm = (dt. getMinutes() +‘' ).padStart(2, '0') const ss = (dt. getSeconds() + ''). padStart(2, '0') return `${y}- ${m} -${d} ${hh}:${mm}:${ss}` }) ~~~ 使用 ![](https://img.kancloud.cn/a1/f3/a1f3129420681af6842a2098e57e3026_985x469.png) # vue 富文本编辑器--书写内容 [https://github.com/surmon-china/vue-quill-editor](https://github.com/surmon-china/vue-quill-editor) ![](https://img.kancloud.cn/94/3e/943e670896ca6e2ce73f64e0133b4957_1240x740.png)