我在本周早些时候提出了一个与此类似的问题,并且取得了更多进展,所以我关闭了上一个并启动了这个问题,因为我也找不到解决方案。
this._scrollRef.scrollTo is not a function
at VirtualizedList.scrollToIndex
这是代码。
<AnimatedFlatList
ref={ (node) => { this._listRef = node; } }
style={[styles.picker, styles.scroll, pickerStyle]}
data={data}
renderItem={this.renderItems}
getItemLayout={(_, index) => (
{ length: 24, offset: 24 * index, index }
)}
initialNumToRender={5}
// scrollEnabled={visibleItemCount < itemCount}
contentContainerStyle={styles.scrollContainer}
scrollEventThrottle={2000}
keyExtractor={(item) => item.value}
automaticallyAdjustContentInsets={false}
removeClippedSubviews={false}
indicatorStyle="white"
/>
Run Code Online (Sandbox Code Playgroud)
在这一点上,我只是不确定为什么通话this._listRef.getNode().scrollToIndex(...params)不起作用。
当涉及到文件管理以及 NodeJS 中没有的内容时,我在围绕几个概念进行思考时遇到了一些麻烦,我想知道是否有人可以为我指明正确的方向。
我有一个上传队列列表,它将根据用户需要同时发生(允许他们随意暂停或删除下载),并且我需要该过程来点击节点服务器以根据需要调整图像大小或操作视频。从这里我需要 Node 通过 S3 上传视频或图像,使用 AWS-SDK(我设置了一个 fakeS3 服务器用于一般沙箱测试),并且在上传时我需要在浏览器中跟踪上传的进度。
我正在使用 React 和 Node 的服务器端渲染,所以我认为必须有一种非常简单的方法来处理这种情况,但我找不到以前做过这件事的人。以下是我弄乱的几个概念:
Server.js(核心输入)
server.use(express.static(path.join(__dirname, 'public')));
server.use(multer({
dest: './public/temp',
limits: {
fieldNameSize: 50,
files: 1,
fields: 5,
fileSize: 1024 * 1024
},
rename: (fieldname, filename) => {
return filename;
},
onFileUploadStart: (file) => {
console.log('Starting file upload process.');
},
inMemory: true
}));
server.use(cookieParser());
server.use(bodyParser.urlencoded({ extended: true }));
server.use(bodyParser.json());
Run Code Online (Sandbox Code Playgroud)
中间路线(/上传什么的)
export function uploadContent(req, res) {
const config = {
s3ForcePathStyle: true,
accessKeyId: 'ACCESS_KEY_ID',
secretAccessKey: 'SECRET_ACCESS_KEY',
endpoint: new AWS.Endpoint('http://localhost:4567'), …Run Code Online (Sandbox Code Playgroud) 这是一个常见的问题,我看到它很多但似乎没什么用.这就是我正在做的事情.我希望我的状态有一些动态动画,所以基本上登录会做一些很酷的动画并进入实际的界面.现在,我开始嵌套这样的视图:
$stateProvider
.state('login', {
url: '/login',
title: "Login",
views: {
"master": {
controller: "LoginController",
templateUrl: "/components/login/login.html",
authentication: false
}
}
})
.state("logout", {
url: "/logout",
title: "Logout",
authentication: false
})
.state('foo', {
url: '/',
controller: "HomeController",
views: {
"master": {
templateUrl: '/components/ui-views/masterView.html'
},
"sidebar@foo": {
templateUrl: '/components/sidebar/_sidebar.html'
},
"header@foo": {
templateUrl: '/components/header/_header.html'
}
}
})
.state('foo.inventory', {
url: '/inventory',
title: "Inventory",
views: {
"content@foo": {
controller: "InventoryController",
templateUrl: "/components/inventory/inventory.html"
}
}
});
Run Code Online (Sandbox Code Playgroud)
因此,在运行此操作时,我需要重定向到注销,但它会卡住.它根本不会从此注销状态移动.以下是我处理的方法:
function run($http, $rootScope, $cookieStore, $state, $templateCache, $timeout, …Run Code Online (Sandbox Code Playgroud) 这似乎是一个很大的问题,而且确实如此,但大部分已经完成,但我实际上已经失去了我想成为的地方.
我已准备好上传表单并且它可以工作,它将其保存到名为upload的文件夹中,但我需要它根据我的会话中保存的酒店名称创建一个文件夹.这将显示在页面上,告诉用户他们所在的会话.所以现在当他们保存时我需要它来创建以它命名的文件夹以将其保存到该目录.所以这是HTML的代码:
<span class="prettyFile">
<form id="form" action="assets/php/upload.php" method="post" enctype="multipart/form-data">
<div class="fileupload fileupload-new" data-provides="fileupload">
<div class="input-append">
<div class="uneditable-input span3" style="margin-top: -3px;"><i class="icon-file fileupload-exists"></i> <span class="fileupload-preview"></span></div><span class="btn btn-file btn-success"><span class="fileupload-new">Upload File</span><span class="fileupload-exists">Change</span><input type="file" name="file" /></span><a href="#" class="btn fileupload-exists btn-success" style="margin-top: -3px;" data-dismiss="fileupload">Remove</a>
<button type="submit" name="submit" class="btn btn-primary fileupload-exists" value="Upload"><i class="icon-cloud-upload"></i> Upload</button>
</div>
</div>
</form>
</span>
Run Code Online (Sandbox Code Playgroud)
这是PHP:
<?php
$allowedExts = array("gif", "jpeg", "jpg", "png");
$temp = explode(".", $_FILES["file"]["name"]);
$extension = end($temp);
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/jpg") …Run Code Online (Sandbox Code Playgroud)