我当前正在使用Material ui v1.4.3自动完成功能。 Material UI指出此自动完成功能已与react-select集成在一起。
我遵循了代码here,该代码的工作原理很不错,但是为了将来处理更大的数据,我想实现搜索功能,只要输入发生更改,就调用数据库,以便能够缩小从数据库中获取的数据的范围。
有人对此有经验吗?因为这段代码中的静态方法阻止了我调用从我的父组件传递来的任何reducer函数。
什么是合适的方法,使我能够捕获用户的输入,以便能够调用函数。
Class tech:
def __init__(self,x,y):
self.t = 0
self.y = y
self.w = np.zeros(shape=(len(y),x))
def update(self,y,f):
#print(list(zip(labels,self.w)))
for i in range(len(y)):
#print (y[i])
#print f
l = max([0,1-y[i]*np.dot(self.w[i],f)])
#print(range(len(self.w[i])))
eta = self.know(l,f)
self.w[i] += eta * y[i] * f
self.t += 1
# x_, f_ and y_ are variables that you must have defined
t = tech(x_,y_)
t.update(y_,f_)
print(t.w)