小飞侠007
vite配置指定浏览器用ip打开?
"server"现在的配置是这样,
server: {
host: "0.0.0.0",
open: true, // 开发服务器启动时,是否自动在浏览器中打开应用程序
}
然后在"env"中添加了配置 "BROWSER='C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'"
现在可以打开浏览器,但是是"localhost"的,现在想打开时直接用"ip" 应该怎么改呢
小飞侠007
el-table自定义列模板使用el-tag或者el-button会出现省略号。这是bug吗,是怎么回事?
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20250113/ad46e625738e86db0ec6c568a5377b27.png)
不需要的话可以覆盖 cell 的 css
小飞侠007
如何在 Taro 框架中使用图表组件?
"https://taro-ext.jd.com/plugin/view/6482e6a18b021898205f1a04" (https://link.segmentfault.com/?enc=Qf2PKMUSTSj2dYQe3SpVEg%3D%3D.O6oWCoCO90AxUO3tyyG0Q45w5VpVGr1fyd6DQkcfRS3p7bPZRAhd0K5WqpYFOJwPwFwltPNIVenFCAuq7NHZag%3D%3D)
可以参考下
小飞侠007
elementui列添加上属性show-overflow-tooltip,如何修改其样式,隐藏掉小三角形?
.el-popper__arrow{
display: none!important;
}
小飞侠007
vue2项目,js里怎么写或者说引入css文件?
目前是这样,三个组件需要用到相同的代码,目前是把代码抽离到了一个js文件里,但是代码里有用到class样式,这时候class应该写在哪里才会生效,是不是需要导入到js里?
***
想到一个办法了,直接在公共的js里引入scss文件,都生效了。我看评论有说在三个组件的style标签里都import,但是这三个style都是scoped的,没生效
小飞侠007
浏览器扩展通信问题为什么只有特定页面可行,其它页面报错(Could not establish connection. Receiving end does not exist)?
«* 写了个网页音乐播放器扩展,本意是想不需要切换到音乐网页去点击切换歌曲,希望扩展在任意网页点击可切换该音乐网页的歌曲。
* 现在遇到的问题是,扩展在在那个音乐网页就可以正常使用(=.=),在其它网页都报错:Unchecked runtime.lastError:
Could not establish connection. Receiving end does not exist.»
manifest.json
{
"name": "播放器",
"version": "0.0.0.1",
"manifest_version": 3,
"description": "用于切换播放模式及控制下一首歌曲的扩展程序",
"icons": {
"128": "icons/128x128.png"
},
"action": {
"default_popup": "popup/popup.html"
},
"content_scripts": [{
"matches": ["音乐播放网页"],
"js": ["lib/jquery.min.js", "content-scripts/content.js"]
}],
"externally_connectable": {
"ids": ["ebjnejafkk*********plickhfn"],
"matches": ["音乐播放网页"]
},
"permissions": [
"tabs",
"scripting"
],
"web_accessible_resources": [{
"resources": ["images/*.jpeg"],
"matches": [""]
}]
}
content.js
//向扩展(popup.js)发送消息
chrome.runtime.sendMessage()
// 接收来自扩展(popup.js)的消息
chrome.runtime.onMessage.addListener()
popup.js
//向content.js(即音乐网页)发送消息
chrome.tabs.sendMessage()
//接收来自content.js(即音乐网页)的消息
chrome.runtime.onMessage.addListener
小飞侠007
如何使用js实现socket通信?
你的意思是你的服务端就是个普通的 TCP 或者 UDP 的 Socket?不是 WebSocket?
那肯定连不上啊……握手失败了自然就断开了……
«浏览器:你好,我想跟你通信,请问你是 WebSocket 吗?
服务端:对不起,我不是。
浏览器:好的,那不打扰了。»
WebSocket 虽然名字里带 Socket,但跟 Socket 根本就不是同一层的网络协议。前者是应用层的,后者是传输控制层的。
你的服务端 Socket 程序如果就监听个 80 端口啥也不干的话,它连 HTTP 协议都处理不了,怎么能处理 WebSocket 协议呢?
小飞侠007
Nuxt3 用 i18n 控制台提示这个是什么意思?
[intlify] the message that is resolve with key 'menu') is not supported for jit compilation
[intlify] the message that is resolve with key 'toggleNavigation') is not supported for jit compilation
[intlify] the message that is resolve with key 'blogMenu') is not supported for jit compilation
[intlify] the message that is resolve with key 'search') is not supported for jit compilation
[intlify] the message that is resolve with key 'aboutMe') is not supported for jit compilation
[intlify] the message that is resolve with key 'menu') is not supported for jit compilation
[intlify] the message that is resolve with key 'toggleNavigation') is not supported for jit compilation
[intlify] the message that is resolve with key 'blogMenu') is not supported for jit compilation
[intlify] the message that is resolve with key 'search') is not supported for jit compilation
[intlify] the message that is resolve with key 'aboutMe') is not supported for jit compilation
[intlify] the message that is resolve with key 'home') is not supported for jit compilation
[intlify] the message that is resolve with key 'readMore') is not supported for jit compilation
[intlify] the message that is resolve with key 'readMore') is not supported for jit compilation
[intlify] the message that is resolve with key 'readMore') is not supported for jit compilation
[intlify] the message that is resolve with key 'readMore') is not supported for jit compilation
[intlify] the message that is resolve with key 'readMore') is not supported for jit compilation
[intlify] the message that is resolve with key 'readMore') is not supported for jit compilation
[intlify] the message that is resolve with key 'readMore') is not supported for jit compilation
[intlify] the message that is resolve with key 'readMore') is not supported for jit compilation
[intlify] the message that is resolve with key 'readMore') is not supported for jit compilation
[intlify] the message that is resolve with key 'readMore') is not supported for jit compilation
[intlify] the message that is resolve with key 'home') is not supported for jit compilation
[intlify] the message that is resolve with key 'readMore') is not supported for jit compilation
[intlify] the message that is resolve with key 'readMore') is not supported for jit compilation
[intlify] the message that is resolve with key 'readMore') is not supported for jit compilation
[intlify] the message that is resolve with key 'readMore') is not supported for jit compilation
[intlify] the message that is resolve with key 'search') is not supported for jit compilation
[intlify] the message that is resolve with key 'categories') is not supported for jit compilation
[intlify] the message that is resolve with key 'recentPosts') is not supported for jit compilation
[intlify] the message that is resolve with key 'subscribe') is not supported for jit compilation
[intlify] the message that is resolve with key 'followOurLatestNews') is not supported for jit compilation
[intlify] the message that is resolve with key 'enterYourEmailAddress') is not supported for jit compilation
[intlify] the message that is resolve with key 'other') is not supported for jit compilation
[intlify] the message that is resolve with key 'login') is not supported for jit compilation
[intlify] the message that is resolve with key 'register') is not supported for jit compilation
小飞侠007
echarts的鼠标位置和数据点展示的tooltip位置对应不上?
echarts的折线图中,鼠标在右侧红圈位置,但是显示的是数据却是左侧红圈的点的数据,tooltip的位置没有跟随鼠标的位置,在mac上没问题,win上有问题,说明只能是分辨率的问题,把window的chrome缩放比例调到67%就没啥问题了,但是echarts官网却没这个问题,有遇到过相同问题的大佬么,请教一下啥原因。
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241231/4b880bbe43501d74b288e1f88b8357c9.png)
下边是我的tooltip的全部代码
tooltip: {
// 悬浮样式
trigger: 'axis',
axisPointer: {
type: 'cross',
animation: false,
},
padding: 0,
borderWidth: 0,
backgroundColor: 'transparent',
formatter: function (params: any) {
// echarts悬浮窗
let str = `
${params[0].name}`;
for (let item of params) {
str += `${item.seriesName}:${parseFloat(item.data).toFixed(2)}`;
}
str += ``;
return str;
},
},
小飞侠007
js 如何将 {a:[Function()]} 写入文件?
我现在是将方法"A"定义在被写入的文件里,然后 "{a:'${A}'}",在写入之前将"'${}'",给删了;但有没有简洁一点的方法呢?
function A( ) {
console.log(1);
}
function process() {
...
}
fs.writeFile(..., process( {a : A} ) , ...);
"process" 如何编写?
小飞侠007
axios响应数据类型怎么定义?
axios响应数据类型怎么定义?
相关代码
type TResponse = ? // 应该怎么定义
service.interceptors.response.use((response : TResponse) => {
const res = response.data // 这个结构是固定的 {code:number;msg:string;data:T}
if (res.code !== 0) {
return Promise.reject(new Error(res.message || "Error"))
} else {
return res
}
},
(error) => {
return Promise.reject(error)
}
)
// 这里code会报错 TS2339: Property code does not exist on type AxiosResponse
getTableData(fileData).then(({ code, data }) => {
if (code !== 0) return
})
小飞侠007
请问如何基于字符串做到JSX呢?
您好,请问下,我有一个字符串,如何用这个字符串作为JSX来使用呢?
const str = "AppComp"
我想要得到这样的JSX:
请问如何基于str这个字符串变量做到""?
***
更新1
因为其他地方已经定义了AppComp,所以直接引入,但是在这进行字符串创建JSX名称使用。
小飞侠007
jqui的draggable功能在scale修改的情况下不能正常运作?
在使用jquery-ui的draggable功能时,若drag对象的父元素经过scale修饰调整了大小的比例,则此时的拖拽会出现拖拽对象瞬移,并且拖拽距离与鼠标距离不同的情况。
小飞侠007
移除轮播图定时器失败?调用轮播函数后,timeID的值为什么还是null?
没有看你logic 从你方法可以看出你在函数里面又声明了一个"var timeID"
function startTimer() {
var timeID = setInterval(function() {
currentIndex++
小飞侠007
在effect中set数据 会导致组件更新了两次 怎么处理?
或许可以借助"useRef",把组件改为完全受控的形式:
function Test3({ data, isActive }){
const storedData = useRef(data);
storedData.current = useMemo(
() =>( isActive? data: storedData.current),
[isActive, data]
);
return {storedData.current}
}
小飞侠007
toRef 的第二个参数的类型是 never?
你这行签名是从 vscode 悬浮框里复制的吧?
其实它是这样的:
export declare function toRef(value: T): T extends () => infer R ? Readonly> : T extends Ref ? T : Ref>;
export declare function toRef(object: T, key: K): ToRef;
export declare function toRef(object: T, key: K, defaultValue: T[K]): ToRef>;
你应该是写了 "toRef",那么 "T" 现在是 "{}" 了,而 "K" 要满足 "keyof T" 的约束,"{}" 没有键,那自然就是
"never" 了
小飞侠007
leader-line划线,使用 grid 模式,如何让折线有圆角?
搬运一下:
"https://codepen.io/mablevi/pen/XWoOZmv" (https://codepen.io/mablevi/pen/XWoOZmv)
参考:
"https://github.com/anseki/leader-line/issues/283" (https://link.segmentfault.com/?enc=aOkWrv3h8Rbq%2BOzEkFz4MA%3D%3D.sXAoDxtKI6%2BsLAmRP%2B0wWBtXz6rAv1JvoqxQ9wgWbuHs2UdFh5ScWxjpqm%2FmFPouKPTPb1E%2BePIDO8X7PFuRkw%3D%3D)
小飞侠007
请问微软如何知道 sql server 2019 没有付款?
请问微软如何知道 sql server 2019 没有付款?
目前想要安装 sql server 2019 官方企业版,公司想被通知付款在购买license,请问微软有办法知道没购买?
我个人是建议公司应该先付款再使用,但公司觉得太贵,被微软发现在付款也来得及,现在僵持在这。
不知道现在业界,对于小公司是否被发现在付款变成常态?
小飞侠007
为什么这里地图没有撑开盒子的高度?
一个是地图组件的初始化时机,初始化的时候外部容器是否有正确的宽高值。一般来说需要给外部容器设置一个有效的高度。
一个是你使用的Tabs组件是否有 "init" 之类的函数可以被手动触发,可能是后期动态修改了内容区域的高度之后。Tabs组件没有动态更新。
小飞侠007
这种怎么让其数字只为整数啊?
"echarts"的很多组件配置中都提供了 "formatter" 方法来进行数据格式化,拿 "tooltip" 举例
* 在 options 的 tooltip 中配置一个 "formatter" 方法
* "formatter" 的入参是当前移入项的相关数据
* 根据实际需求组装一个 "dom string" 返回即可const option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
tooltip: {
trigger: 'axis',
formatter(params) {
const [param] = params;
const { axisValue, marker, value } = param
return "${axisValue} ${marker}${value.toFixed(0)}"
}
},
series: [
{
data: [150.23, 230.56, 224.23, 218.48, 135.23, 147.69, 260.56],
type: 'line'
}
]
};
效果如下
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241207/f44aeb86d11e39c061a4d3ab6f2c38be.png)
小飞侠007
二重积分求积分区域?
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241205/d048f8c07390e93eaf2cccfaa427e334.png)
求大佬解释下这个结果怎么算出来的? 如何确定积分的区域呢?
小飞侠007
包含长空格的类名如何在css中引用?
这个div,在css中如何引用?
1. div.left item{}
2. div.left\ item{}
我测试了上面两种方式都不行?
小飞侠007
解析网站的时候遇到乱码怎么解决?
一种是你这个资源是音视频的资源,本身就是需要解码器的。
另一种就是人为有加密。
看你这个 M4S 属于第一种,你随便看一个 pdf 或者 MP4 应该都是这种
小飞侠007
前端拿到UI给的蓝湖设计稿,该如何开始写?
因为之前一直写的后台系统的简单业务,这次改别的项目的UI,需要自己写css还有一些布局,还涉及到大屏,有用到echarts,所以有一些问题想请教下大家:
问题1:
设计稿是1920*1080的,我画页面的时候,宽高怎么去写呢,比如一些很细节的宽200px,边距40px,我要去写固定值么,但这样在我笔记本上看着元素就很大··
不太知道怎么去布局写
问题2:
echarts我之前没写过,刚刚看了下文档,很多参数需要配置,UI给的图有一些很细节的间距,或者大小,要怎么去处理呢?有没有经验或者注意事项可以给我参考一下呢
其他暂时还没想到,自己对样式这块太菜了,就是很难受哇
小飞侠007
MybatisPlus查询百万数据的内存占用问题?
我在表里添加了500W的测试数据,表中数据如下
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241125/41cfff4273d6b7aa8381bcef5bbce355.png)
一次性读取 500w 数据到 JVM 内存中 必然会造成OOM现象,所以我分别试验了2个读取百万数据的方式,并用Junit分析内存占用
1. 分页多次查询,并进行深度分页优化@Test
void testPage(){
//查询出表中总记录数
Long total = orderMapper.selectCount(null);
//每次分页读取的结果数
int fetchSize = 100000;
// 分页优化参数,上次查询的最大ID
int lastMaxId = 0;
for (int i = 0; i orderLambdaQueryWrapper = new LambdaQueryWrapper();
orderLambdaQueryWrapper.gt(Order::getOrderId, lastMaxId);
List records = orderMapper.selectPage(new Page(1, fetchSize), orderLambdaQueryWrapper).getRecords();
records.stream().forEach(System.out::println);
//获取本次最大的Id
lastMaxId = records.get(records.size() - 1).getOrderId();
}}
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241125/960b4723c7c7796e38512faa89f0582b.png)
2. Mybatis的流式查询@Test
void testStream() {
orderMapper.selectList(Wrappers.emptyWrapper(), resultContext -> {
// 依次得到每条业务记录
System.out.println("当前处理第" + resultContext.getResultCount() + "条记录.");
Object order = resultContext.getResultObject();
System.out.println(order);
//做自己的业务处理,比如分发任务
});
}
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241125/8cb43914a1637230b2dd0e8af8baa607.png)
我从网上看了许多博客,说流式查询可以很好避免OOM问题。
但是为什么在分析堆内存占用中,反而是 多次分页查询的内存占用更小,平均只有400MB
而流式查询却能高达平均1GB的占用?
«关于如何开启流式查询是参考的MybatisPlus官网,MybatisPlus版本是也最新的。"https://baomidou.com/pages/1922u2/" (https://link.segmentfault.com/?enc=HfCA4OwGKsgEPO85IcCWLA%3D%3D.RukAgmXhqHctfv9iSswumgaajs20fAqWApiCgHe4saFWwg8ezf7inhDp65Q%2B7L6v)»
小飞侠007
请问VUE3使用echarts按需引入写在每个组件内还是写在全局?
有影响的。
习惯要从一开始养成
今天一个 echarts,明天一个 moment,后天一个 lodash,之后还有 monaco、antd、elementui、x6、d3
从最开始,你就需要让资源在使用时才被引入
小飞侠007
给tag导航栏绑定v-show,指定在当前路由为/home时不显示?
不生效
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241124/9ac65f15d98a7c9d58fe59f398d89334.png)
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241124/b67d1e16e02de36fc880835637d16352.png)
小飞侠007
get请求为什么有的请求参数放到链接后面有的放到请求参数中?
今天调用了一个接口,接口要求传一个日期过去,当时没仔细看(因为文档也没写请求参数和相应参数),以为是传一个data,里面有条件查询的参数之类的,结果第一次报错。
export function todayUserNum(data){
return request({
url:'/system/home/todayNum',
method:'get',
data:data
})
}
"Required request parameter 'date' for method parameter type String is not present(方法参数类型字符串所需的请求参数“日期”不存在)"
后面第二次调用的时候注意到了文档上的参数说明,于是就改成了这个样子
export function todayUserNum(date){
return request({
url:'/system/home/todayNum',
method:'get',
params:date
})
}
同样接口给我抛出了上述的错误,并且我的请求参数值被分割了,我意识到可能是框架的某块公用请求将参数值分割了。我又更换了一次写法
export function todayUserNum(date){
return request({
url:'/system/home/todayNum?date='+date,
method:'get'
})
}
这次接口成功获取到了数据,但是我又试了试另一种写法
export function todayUserNum(date){
return request({
url:'/system/home/todayNum'+date,
method:'get'
})
}
这时候接口抛出了404异常
"Error: Request failed with status code 404"
我又又尝试了一下其他写法,这一次,我将请求参数放在了请求体里面
export function todayUserNum(date){
return request({
url:'/system/home/todayNum'+date,
method:'get',
params:{
date:date
}
})
}
接口请求成功
但是有的接口的get请求方式就用上述的某种方法可以走通,比如:
1. export function getCheck(id) {
return request({
url: '/system/check/' + id,
method: 'get'
})
}
2. export function listCheck(query) {
return request({
url: '/system/check/list',
method: 'get',
params: query
})
}
我不太懂这种写在链接后的和写在请求体上的区别在哪里,而且也不太懂为什么有的参数可以直接将值放上去,有的要规定请求参数名和值,希望大佬可以解答一下
小飞侠007
有种效果用css怎么实现?
使用flex布局
开卡建档
门诊充值
缴费
小飞侠007
有没有好用的Git代码统计工具?
求推荐一款git代码统计工具,能看到 代码的提交统计。比如:最近一周 项目的各成员,提交了多少代码,提交次数,提交代码行数,新增数量,删除数量。
看过 gitstat ,但总感觉用起来有点麻烦。
小飞侠007
哪位高手能给看下,这张图片上面的黄色文字是什么字体?
汉仪铸字木头人字体
"https://font.chinaz.com/200818159552.htm" (https://link.segmentfault.com/?enc=IhcTEI%2BSWARV1qmhNVLxCA%3D%3D.9TVrRyl8ZSGrCXA1cwP9VAAO%2FEQkE3GOCOT%2F7EWSYaDif4gCF3lz4%2BOFvHSS%2Fe3A)
"1701762821656.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241106/294d41ab7a935eefadbc87219a0ddbc5.png)
小飞侠007
ESLint错误代码未提示?
eslint安装了 为啥写错误代码没有提示波浪号
运行命令检查是会报错的
"image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241029/45c5eb72e7673e25f588f6d602b58849.png)
"image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241029/0259d047c5b1faa8d6d6fa89db69713e.png)
"image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241029/e1860f872feea13be6389313b8e6583c.png)
小飞侠007
为何react hook 无法在组件外使用?
是否可以在全局做点工作,让hook可以在组件外的js 中使用?
小飞侠007
Vue项目代理配置与响应标头的Set-Cookie的冲突怎么办?
案例:
proxy: {
'/api': {
target: 'http://localhost'
changeOrigin: true,
cookiePathRewrite: {
'*': 'http://localhost:8080'
},
cookieDomainRewrite: {
'*': 'localhost:8080'
},
pathRewrite: {
['^']: ''
}
}
实现:
proxy: {
'/': {
target: process.env.VUE_APP_API_BASE_URL,
changeOrigin: true,
cookieDomainRewrite: 'localhost'
}
}
小飞侠007
sql 中变量名怎么改成动态公式获取?
1. 利用CONCAT和CURRENT_YEAR函数SELECT '222' AS CONCAT(CURRENT_YEAR, '订货额') FROM DUMMY
2. 利用TO_VARCHAR 函数字符串拼接SELECT '222' AS TO_VARCHAR(CURRENT_TIMESTAMP, 'YYYY') || '订货额' FROM DUMMY
小飞侠007
如何在CentOS 7.9上安装Node.js的高版本(18以上)?
实在不行你就装个docker 这样就不会影响环境了
小飞侠007
如何在 Chrome DevTools 中模拟 10 倍性能降低?
找到了这篇可以用~ 感谢大佬们的回复
"https://dev.to/kaziusan/i-wanna-make-cpu-slower-than-default-setting-in-chrome-devtool--3bb" (https://link.segmentfault.com/?enc=CvbyVDZf17GYduPvrLTO9w%3D%3D.fq2r0eUizeUP6tgKHdMzUOmuZxmkP2u4hqO6X9TJuRZBVcBjYe0VtN5Ecv3B%2Fxoj0fxLRqykW3h2zMOdgMUkUVjk%2Bw%2FZ3uhHgHWC4mkMvcI3G8aZK9k8NOHnN3dALyYE)
小飞侠007
C++代码为什么总提示"expected a declaration"错误?
for 语句只能出现在函数里。
小飞侠007
IIS6不能支持php7了吗?
iis6是支持php的但是现在技术架构选型很少是这个架构了,建议你使用nginx
小飞侠007
vue2中路由怎么301到新的网站?
vue2中路由怎么301到新的网站
我有个关于(about)页面,我是写在vue路由里的,当我点击关于按钮时直接跳的vue路由里的about,我现在要把about页面放到了别的项目下,想实现当我点击关于按钮时,跳转另一个项目的about,如果我直接访问另一个项目/about,这样是能跳转,但会造成用户收藏的连接报错问题,和出现seo问题
我想到了在nginx里做301
location /aboutus {
#add_header Cache-Control no-store;
# 永久重定向
rewrite ^ http://baidu.com permanent;
}
但是nginx和vuerouter是两个系统,还是会先跳转我原来项目的about页面,有没有大佬知道应该怎么解决呢
小飞侠007
如何实现 grid 布局顶部对齐?
各位好,我在用 grid 做一个页面的布局,请看代码
hello1
hello2
hello3
hello4
hello5
hello6
hello7
我想实现的是一共分三列,最左边的一列是 hello1 和 hello2;中间是 3,4,5;最右侧是 6 和 7。 css 部分代码如下
.fruit-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
align-items: start;
}
.fruit {
width: 100%;
margin-bottom: 10px;
}
/* 显示在最左 */
.fruit:nth-child(1),
.fruit:nth-child(2) {
grid-column: 1;
}
/* 显示在中间 */
.fruit:nth-child(3),
.fruit:nth-child(4),
.fruit:nth-child(5) {
grid-column: 2;
}
/* 显示在最右 */
.fruit:nth-child(6),
.fruit:nth-child(7) {
grid-column: 3;
}
现在遇到的问题是,中间和右侧的内容不顶部对齐,我想要的显示形式是
1 3 6
2 4 7
5
但实际的效果是
1
2 3
4
5 6
7
请问这个该怎么解决,谢谢。
如上问题所说,想知道错在哪里了
小飞侠007
vue2.x,el-table 切换编辑模式后,部分单位格中是 el-select,导致渲染卡顿时间很久,有什么解决方式吗?
和产品商量一下改变交互吧,同一时间内用户应该只能改变一个下拉框的值,所以没必要把所有的下拉框同时渲染出来。可以通过双击单元格或者单独在单元格内放一个编辑按钮这样的形式来渲染下拉框。
小飞侠007
amfile-3.7文件管理突然就不显示文件列表了?
没对面板做过什么操作吗,正常不会自己出问题的啊。
可以在软件商店重装一次amfile文件管理软件。
如果重装amfile还有问题,可以在ssh执行命令,
amh amfile-3.7 admin ls /home/
看有没报错。
小飞侠007
React 的 Hooks 为什么获取不到最新值?
下面代码打印出来是空字符:这难道不是会更新的么:用的是蚂蚁的组件
import { Api_Module_Edit_Prepare, Api_Module_Edit_Save } from "../Request/Module"
import { Input, Card, Form, Row, Col, Space, Collapse, Button, message } from 'antd';
import { useNavigate, useParams } from "react-router-dom";
import { useEffect, useState } from "react";
import "../Css/Edit.sass"
export function Component() {
const navigate = useNavigate();
const { module = "", id = 0 } = useParams();
const [primary] = Form.useForm();
const [messageApi, contextHolder] = message.useMessage();
const [tableActive, setTableActive] = useState(``)
const [tableData, setTableData] = useState>({})
const [tabList, setTabList] = useState([]);
const onFinish = (data: any) => {
const params = { table: tableActive, data: data }
Api_Module_Edit_Save(module, [params]).then((res) => {
messageApi.success("保存成功")
})
}
// 渲染:表单【 主表 + 子表 】:Card
const formatTableData = (data: any) => data.reduce((loop: any, item: any, index: number) => ({
...loop,
[item.table_name]: index === 0 ? renderFormItem(item) : renderTableItem(item)
}), {});
// 渲染:标签【 主表 + 子表 】
const formatTableTabs = (data: any) => data.map((item: any) => ({
key: item.table_name,
tab: item.display_name,
}))
// 渲染:主表表单
const renderFormItem = (table: any) => {
const renderFormItem = (columns: any) => columns.map((column: any) => (
))
return (
{table.sections.map((section: any) => (
{renderFormItem(section.columns)}
}]} />
))}
)
}
// 渲染:子表数据
const renderTableItem = (data: any) => data.map((item: any) => ({
}))
// 渲染:公共操作
const renderPublicActions = [
navigate(-1)}>返回
primary.submit()}>保存
]
useEffect(() => {
Api_Module_Edit_Prepare(module).then((res) => {
setTableData(formatTableData(res.form))
setTabList(formatTableTabs(res.form))
setTableActive(res.form[0].table_name)
})
}, [module])
return (
{contextHolder}
{tableData[tableActive]}
)
}
Component.displayName = "Edit";
}, [module])
小飞侠007
如何用CSS制作平滑的半圆形tabbar?
你就按几何形状做,没必要那么扣细节。
就是一个长方形叠加一个圆形 z轴长方形在下面,圆形在上面就行了。
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20241012/8be581b3224ea877dc8a293461723ece.png)
小飞侠007
vue3 父级传给子组件render函数时的scopeId和父级不一致?
父级:
import { defineComponent, h, withCtx, getCurrentInstance } from 'vue'
import Comp from './Comp.vue'
export default defineComponent({
components: { Comp },
setup() {
const ins = getCurrentInstance()
return {
r: () => h('span', { class: 'span' }, '哈哈')
// r: withCtx(() => h('span', { class: 'span' }, '哈哈'), ins)
}
},
})
.span {
color: blue;
}
子组件:
import { defineComponent, h } from 'vue'
export default defineComponent({
name: 'Comp',
props: { r: Function },
setup(props) {
return () => h('div', { class: 'comp' }, props.r())
},
})
.comp {
color: red
}
https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20241013/d7d51016aa0fe29b502b90c244418c23.png
https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20241013/289f36ae926428e0f3e0dbd70f4496af.png
如果使用"withCtx(() => h('span', { class: 'span' }, '哈哈'), ins)"是可以让"span"的"scopeId"和父级一致,但是这样必须在每个使用了子组件的父级里写一遍,太麻烦还容易漏,官方文档根本没写这东西
所以有没有一种方式,能通过修改子组件,父级不需要传其他乱七八糟的比如"instance"之类的给子组件,就能达到说子组件接收的"render"函数始终使用传入者的"scopeId"?
小飞侠007
怎么更改echarts中刻度线之间的距离,改的小一点,用哪个属性?
yAxis,xAxis中有个"splitNumber"可以尝试下
小飞侠007
请教vue+elementUI怎么实现动态下拉框的表格效果?
可以做到的,表格的第一条数据单独处理下就可以实现
"image.png" (https://wmprod.oss-cn-shanghai.aliyuncs.com/c/user/20241010/8d3952b91b046619e91c6aa2a99ac3e4.png)
具体实现:"示例代码" (https://codepen.io/dulily/pen/bGZyWpG)
小飞侠007
html 如何将滚动条定位到特定div?
滚动条显示位置都是在最右侧或最底部,怎样控制滚动条显示在某一个div里面或为一个位置?
不是说滚动位置,滚动条的显示位置
小飞侠007
有什么开源免费的 ocr 可以识别下面的图片中的文字:「禁闭岛」?
试了 "Umi-OCR" (https://link.segmentfault.com/?enc=Xz%2BqFru8j59Zk7MoR3AmDw%3D%3D.kslHjPdlNwbtIym41zqGDRw2v47b5jbC0oE78SFW75bKqGwTlWQI%2B%2BcHiIJXSaCE)
这两张都可以识别
调用服务就行"cli" (https://link.segmentfault.com/?enc=PCmlhUjYsArC9OBK5x3ucg%3D%3D.Ml5fxcLn2L1sy%2BoM3%2FacAa8LyNqW%2FFuzHWKKTWd5bEQmE%2Fy8rvnICLyj33tlja4gponU0Tp1lL9kW9eqcwgND4yjNXsA2d8hlpSWVj0nmQI%3D)
,
"http" (https://link.segmentfault.com/?enc=eLdQPLo9N9pRU39tjhlycA%3D%3D.Pv1%2BFylHDLt5THScmAGnDoTn0fqXow4b%2FIbQQpp3xW6VcZqcrd36Gb7gNhy7RNZV55KgQTXivIJbUe42XJnNBsPOMoKpieKGd4c9GfHmXcE%3D)