当前位置: 首页 > news >正文

男女做暖暖其他网站百度广告一天多少钱

男女做暖暖其他网站,百度广告一天多少钱,网站建设 培训班 成都,无锡网站推广Vue3 Element-Plus 使用 Table 插槽时数据未及时更新 问题重现解决方法最终效果 问题重现 这里我已经通过二级分类 id 查询到一级分类和二级分类&#xff0c;但是使用插槽和 v-for 渲染出来还是之前的分类 id&#xff0c;但是一点击表格或者保存代码他又能正常刷新出来。 <…

Vue3 + Element-Plus 使用 Table 插槽时数据未及时更新

  • 问题重现
  • 解决方法
  • 最终效果

问题重现


这里我已经通过二级分类 id 查询到一级分类和二级分类,但是使用插槽和 v-for 渲染出来还是之前的分类 id,但是一点击表格或者保存代码他又能正常刷新出来。

在这里插入图片描述

<template><el-table :height="tableHeight" :data="tableList" border stripe><el-table-column prop="goodsDesc" label="商品简介" align="center"></el-table-column><el-table-column prop="categoryId" label="分类" align="center"><template #default="scope" style="display: flex;"><el-tag style="margin-left: 10px;" type="success" effect="dark" v-for="(item, index) in scope.row.categoryId" :key="index">{{ item }}</el-tag></template></el-table-column></el-table>
</template><script setup lang="ts">
import { onMounted, ref } from 'vue';
// 表格数据
const tableList = ref([]);
// 列表查询
const getList = async () => {let res = await getGoodsListApi(searchParm, "0");if (res && res.code == 200) {// 获取出图片和视频列表res.data.records.forEach((goods: any) => {// 分割 image 属性,得到图片和视频链接数组// 通过二级分类标签获取整个分类类别let res = getGoodsTypeBySonIdApi(goods.categoryId);res.then((value) => {goods.categoryId = value.data;});const imageArray = goods.image.split(',');// 判断每个链接的类型并添加对应的属性imageArray.forEach((url: String) => {if (url.endsWith('.png') || url.endsWith('.jpg') || url.endsWith('.jpeg')) {// 图片链接if (!goods.images) {goods.images = [];}goods.images.push(url);} else if (url.endsWith('.mp4') || url.endsWith('.avi') || url.endsWith('.mov')) {// 视频链接if (!goods.videos) {goods.videos = [];}goods.videos.push(url);}});// 删除原始的 image 属性delete goods.image;});tableList.value = res.data.records;searchParm.total = res.data.total;}
}
onMounted(() => {tableHeight.value = window.innerHeight - 200;getList();
})

处理后的数据示例

[{"goodsId": 3,"userId": 7,"orderId": null,"categoryId": ["数码","电脑"],"type": "0","goodsName": null,"goodsDesc": "这是二条测试数据","goodsOldPrice": 200,"goodsNewPrice": 100,"isNew": null,"tradingType": "邮寄","findType": "QQ","findValue": "13036497562","wxNum": 0,"status": "1","sellStatus": null,"createTime": "2024-04-14","sellTime": null,"address": "北京市东城区东华门街道锡拉胡同北京利生体育商厦, 39.916405, 116.410243","deleteStatus": "0","userById": 0,"images": [],"videos": []},{"goodsId": 1,"userId": 7,"orderId": null,"categoryId": ["数码","电脑"],"type": "0","goodsName": null,"goodsDesc": "这是一条测试数据","goodsOldPrice": 200,"goodsNewPrice": 100,"isNew": null,"tradingType": "面交","findType": "手机号","findValue": "13036497562","wxNum": 0,"status": "1","sellStatus": null,"createTime": "2024-04-14","sellTime": null,"address": "北京市东城区东华门街道锡拉胡同北京利生体育商厦, 39.916405, 116.410243","deleteStatus": null,"userById": 0,"images": [],"videos": []}
]

解决方法


通过二级分类标签获取整个分类类别
不与
获取出图片和视频列表操作
同时进行

// 列表查询
const getList = async () => {let res = await getGoodsListApi(searchParm, "0");if (res && res.code == 200) {// 获取出图片和视频列表res.data.records.forEach((goods: any) => {// 分割 image 属性,得到图片和视频链接数组const imageArray = goods.image.split(',');// 判断每个链接的类型并添加对应的属性imageArray.forEach((url: String) => {if (url.endsWith('.png') || url.endsWith('.jpg') || url.endsWith('.jpeg')) {// 图片链接if (!goods.images) {goods.images = [];}goods.images.push(url);} else if (url.endsWith('.mp4') || url.endsWith('.avi') || url.endsWith('.mov')) {// 视频链接if (!goods.videos) {goods.videos = [];}goods.videos.push(url);}});// 删除原始的 image 属性delete goods.image;});tableList.value = res.data.records;searchParm.total = res.data.total;getAllType();}
}// 通过二级分类标签获取整个分类类别
const getAllType = () => {tableList.value.forEach((goods: any) => {// 通过二级分类标签获取整个分类类别let res = getGoodsTypeBySonIdApi(goods.categoryId);res.then((value) => {goods.categoryId = value.data;  });})
}

最终效果

在这里插入图片描述

http://www.sczhlp.com/news/34858/

相关文章:

  • 珠海网站建设网络公司怎么样交友网站有哪些
  • 做推广自己找网站百度权重怎么看
  • 温州专业微网站制作多少钱大地seo视频
  • 娱乐类网站怎么建设seo 的作用和意义
  • 定制网站开发seo怎么快速提高排名
  • 营销网站建设的原则百度竞价培训
  • 网站内容优化方法有哪些内容免费推广网站平台
  • wordpress xiu 5.5信阳搜索引擎优化
  • 注册企业查询汨罗网站seo
  • 正定县建设局 网站西安疫情最新情况
  • 武汉 外贸网站建设公司网站营销策划公司
  • 东莞网站快速排名提升软文营销经典案例
  • 20250824 之所思 - 人生如梦
  • 深圳网络科技有限公司排名重庆seo推广服务
  • 网站建设合作合同模板下载百度推广售后电话
  • 网站正能量免费下载教你如何快速建站
  • 做网站用boot免费推广平台排行
  • 互联网+创新创业百度seo优化方案
  • 朝阳做网站公司百度官方下载
  • 网站留言怎么做网络营销与策划试题及答案
  • 网站建设时间怎么查湖南网站营销推广
  • 哪些是asp网站广告策划案优秀案例
  • 360的网站怎么做网络营销的有哪些特点
  • 上海网站建设多少钱昆明seo案例
  • 8.24模拟赛糊糊题解
  • 做题整理
  • 电机控制笔记:BLDC控制原理
  • 我的译作
  • int a=3, b; b=a+3; { int c=2; a*=c+1; } printf(%d\n, a);
  • 关于集团网站建设的修改请示品牌营销案例