如何在ReactJS中选择一个空目录?

我想为我的项目选择一个空目录/文件夹(不是任何文件)。我已经尝试过

from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels import RBF,WhiteKernel,ConstantKernel kernel = ConstantKernel() * RBF() + ConstantKernel() * RBF( ) gp = GaussianProcessRegressor(kernel=kernel,n_restarts_optimizer=10) import numpy as np x = np.linspace(0,10,100) y = 3*np.sin(x) + np.sin(x*5) gp.fit(x.reshape(-1,1),y) print(gp.kernel_) # We can make predictions using both components of the kernel: # is it possible to make predictions on each component # individually? y_hat = gp.predict(x.reshape(-1,1))

这将选择目录中的文件并显示所选的文件。

如果我选择一个空目录,由于其中没有文件,因此选择后会显示“未选择文件”

我只想选择一个空目录(不选择任何文件)。我该怎么解决?

GFHJTYHTR 回答:如何在ReactJS中选择一个空目录?

我认为这个问题与one here的重复

<input type="file" id="ctrl" webkitdirectory directory multiple/>
  

Example

,

在任何主流浏览器中都没有内置控件,该控件使用户可以轻松选择文件夹。最接近的是<input type="file">,但这仅允许您选择文件夹中的单个文件,而不能选择文件夹本身。

您只能做的另一件事是创建一个用户必须批准的控件,然后才能使用它。

https://www.tek-tips.com/faqs.cfm?fid=5201

找到了以上答案
本文链接:https://www.f2er.com/3168948.html

大家都在问