评论
相关内容
0个评论
全部评论
点击登录,快来和大家讨论吧~
表情
图片
暂无评论
内容推荐
Agent-Reach实测:让AI Agent一键搜索全网,我踩了3个大坑
4
HR问我"为什么35岁想退休",我愣住了
5
图像复原和扩散模型怎么入门啊,纯新手小白啥都不会,求大佬们指点一下方向
0
【入职求助贴】萌新刚入职某大厂做后端开发,目前还在试用期。最近遇到一个棘手的问题,想向大家求助一下。入职不久,leader 给我派了一个任务。跟我说是0.5天就可以解决,我刚毕业入职,做了一个星期没有做出来。实现一个收集定时成功任务的案例。听起来好像不复杂,但我自己摸索着做了一整个星期,到现在还没达到预期效果。这一周我基本是“边学边做”的状态,遇到卡点也会每天主动找 leader 沟通进度和疑问。
2
🐟友们,工作后,周末你们一般都干啥🤔
0
作者分享
觉得好多实践项目都以java为主,有没有go语言或者ts的项目这种轻量的课程
1
写微信小程序想显示数据库数据的时候遇到这种显示不全的情况,找了半天不知道哪里有问题,请教一下
wxml:
<scroll-view scroll-x="true" class="scroll-view-x">
<view class="table">
<!-- 表头 -->
<view class="tr header">
<view class="td">id</view>
<view class="td">sugar</view>
<view class="td" style="width: 119px;">vc</view>
<!-- 动态生成列标题 -->
<block wx:for="{{numList}}" wx:key="*this">
<view class="td">num{{item}}</view>
</block>
</view>
<!-- 数据行,内嵌垂直滚动 -->
<scroll-view scroll-y="true" class="scroll-view-y">
<block wx:for="{{dataList}}" wx:key="index">
<view class="tr">
<!-- 动态渲染每一行 -->
<view class="td">{{item.id}}</view>
<view class="td">{{item.sugar}}</view>
<view class="td">{{item.vc}}</view>
<block wx:for="{{numList}}" wx:for-item="j" wx:key="*this">
<view class="td">{{item['num' + j] || '-'}}</view>
</block>
</view>
</block>
</scroll-view>
</view>
</scroll-view>
WXSS:
/* 滚动区域:水平滚动 */
.scroll-view-x {
white-space: nowrap; /* 防止内容自动换行 */
overflow-x: auto; /* 开启水平滚动 */
background-color: #f9f9f9;
}
/* 滚动区域:垂直滚动 */
.scroll-view-y {
max-height: 400px; /* 限定表格最大高度,可根据需要调整 */
overflow-y: auto; /* 开启垂直滚动 */
}
/* 表格容器 */
.table {
display: inline-block; /* 允许表格在水平滚动中扩展宽度 */
width: max-content; /* 表格宽度根据内容动态调整 */
border-collapse: collapse; /* 去掉单元格之间的间距 */
}
/* 行 */
.tr {
display: flex; /* 使用 flex 布局,让行内容水平排列 */
background-color: #fff;
}
/* 表头样式 */
.tr.header {
background-color: #f0f0f0; /* 表头背景色 */
font-weight: bold; /* 表头加粗 */
position: sticky; /* 表头固定在顶部 */
top: 0;
z-index: 10;
}
/* 单元格 */
.td {
flex: 0 0 100px; /* 单元格宽度固定 */
padding: 8px 8px; /* 单元格内边距 */
text-align: center; /* 文本居中 */
border: 1px solid #ddd; /* 单元格边框 */
box-sizing: border-box; /* 包括边框在内计算宽度 */
}
/* 特殊宽度单元格 */
.td[style] {
flex: 0 0 119px; /* 根据表头的样式要求设置宽度 */
}
/* 表格行样式 */
.tr:nth-child(odd) {
background-color: #f8f8f8; /* 奇数行背景色 */
}
.tr:nth-child(even) {
background-color: #ffffff; /* 偶数行背景色 */
}
js:
Page({
data: {
dataList: [],
loading: false,
noMoreData: false,
currentPage: 1,
pageSize: 10,
totalRecords: 0,
totalPages: 0,
numList: Array.from({ length: 44 }, (_, i) => i + 1)
},
onLoad: function() {
this.loadMoreData();
},
touch_add() {
if (this.data.currentPage < this.data.totalPages) {
this.setData({
currentPage: this.data.currentPage + 1
}, () => {
this.loadMoreData();
});
}
},
touch_reduce() {
if (this.data.currentPage > 1) {
this.setData({
currentPage: this.data.currentPage - 1
}, () => {
this.loadMoreData();
});
}
},
loadMoreData: function() {
if (this.data.loading || this.data.noMoreData) {
return;
}
this.setData({ loading: true });
wx.request({
url: 'http://127.0.0.1:5000/all',
data: {
page: this.data.currentPage,
per_page: this.data.pageSize
},
method: 'GET',
success: (res) => {
const newData = res.data.data;
const newTotalRecords = res.data.pagination.total_records;
const newTotalPages = res.data.pagination.total_pages;
this.setData({
dataList: this.data.dataList.concat(newData),
currentPage: this.data.currentPage,
totalRecords: newTotalRecords,
totalPages: newTotalPages,
loading: false
});
if (this.data.currentPage > newTotalPages) {
this.setData({ noMoreData: true });
}
},
fail: (err) => {
console.error(err);
this.setData({ loading: false });
}
});
}
});
2
ones管理平台有没谁用过啊,老板叫我开发这玩意的插件,完全没用过看不懂😂
2
navicat连接服务器上的MySQL死活连接不上,配置都搞好了还是提示2002 - Can't connect to server on 'ip' (10060),数据库启动了,配置已经更新,ping服务器地址又是通的
3
鱼皮项目后端代码经常不知道为什么这么打,模板看不懂,是有哪些基础是要学的吗
2

