请告诉我,如果我们可以自定义item-text的v-select?
我想自定义每个项目v-select,如下所示:
:item-text="item.name - item.description"
Run Code Online (Sandbox Code Playgroud) 我正在使用Vuetify和VueJS(最新版本).
这是Login.vue的小模板:
<template>
<v-layout align-center justify-center>
<v-flex xs12 sm8 md4>
<v-card class="elevation-12">
<v-toolbar dark color="success">
<v-toolbar-title>Login form</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-card-text>
<v-form @submit.prevent="checkLogin">
<v-text-field prepend-icon="person" id="userLogin" v-model="userLogin" placeholder="my@login.com"></v-text-field>
<v-text-field prepend-icon="lock" id="userPassword" v-model="userPassword" placeholder="password" type="password"></v-text-field>
</v-form>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<!-- TODO fix the bug when form.submit not works -->
<v-btn type="submit" color="success">Login</v-btn>
</v-card-actions>
</v-card>
</v-flex>
</v-layout>
</template>
Run Code Online (Sandbox Code Playgroud)
因此,如果你看到,v-form上有一个带有checkLogin调用的@ submit.prevent,它在点击提交按钮时没有工作,也没有在输入时按下回车按钮.在没有阻止的情况下使用@submit也没有任何效果.
但!如果我在v-btn上放置事件处理程序,如下所示:
<v-btn @click.native="checkLogin">
Run Code Online (Sandbox Code Playgroud)
单击按钮(未按输入字段中的输入)后,所有工作都按预期工作.
那么,请你告诉我,v-form submition事件处理我做错了什么?谢谢!
我使用100%工作袜子,我无法通过我的应用程序连接.
SocketAddress proxyAddr = new InetSocketAddress("1.1.1.1", 12345);
Proxy pr = new Proxy(Proxy.Type.SOCKS, proxyAddr);
try
{
HttpURLConnection con = (HttpURLConnection) new URL(url).openConnection(pr);
con.setConnectTimeout(proxyTimeout * 1000);
con.setReadTimeout(proxyTimeout * 1000);
con.connect();
System.out.println(con.usingProxy());
}
catch(IOException ex)
{
Logger.getLogger(Enter.class.getName()).log(Level.SEVERE, null, ex);
}
Run Code Online (Sandbox Code Playgroud)
那么我做错了什么?如果我将HTTP与一些HTTP代理一起使用,那么一切正常,但不是SOCKS.
NetBeans 6.9.1,这是导入的MinGW utils的屏幕截图:

当我在设置断点后尝试运行调试器时会发生这种情况:
因此NetBeans没有看到断点,也没有gdb日志.我究竟做错了什么?
我的代码:
String[] torrentFiles = new File("/root/torrents/").list();
if(torrentFiles.length == 0 || torrentFiles == null)
{
System.exit(0);
}
ex = Executors.newFixedThreadPool(3);
for(String torrentFile : torrentFiles)
{
ex.submit(new DownloadTorrent("/root/torrents/" + torrentFile));
}
ex.shutdown();
try
{
ex.awaitTermination(30, TimeUnit.MINUTES);
}
catch(InterruptedException ex1)
{
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex1);
}
Run Code Online (Sandbox Code Playgroud)
但有时洪流下载需要未知的时间价值,« awaitTermination»不能按我的意愿工作.我需要在半小时后立即停止所有执行的线程,但据我所知« awaitTermination»只使用interrupt()仅在循环或等待中工作的方法.如果这一刻发生,超时不起作用.那么,怎么样?
这是我的 package.json:
{
"name": "DFS",
"version": "1.0.0",
"description": "DFS App",
"author": "asd",
"private": true,
"nodemonConfig": {
"delay": "2500"
},
"scripts": {
"postinstall": "npm run build",
"dev": "node build/dev-server.js",
"start": "node build/dev-server.js",
"build": "node build/build.js",
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
"deploy": "git subtree push --prefix dist heroku master"
},
"dependencies": {
"axios": "^0.16.2",
"connect-history-api-fallback": "^1.5.0",
"express-sslify": "^1.2.0",
"global": "^4.3.2",
"heroku-ssl-redirect": "0.0.4", …Run Code Online (Sandbox Code Playgroud) 例如,我需要始终运行100个线程来执行某些操作.我有一个类调用ThreadsWorker,它会查找线程计数并运行缺少的线程,如果前面的一些完成.所以,这是描述情况的表:
1 second: 100 threads
2 second: 92 threads (ThreadsWorker generates new 8 threads)
3 second: 100 theads
4 second: 72 threads (ThreadsWorker generates 28 threads)
Run Code Online (Sandbox Code Playgroud)
等等.我的线程是匿名调用(只是new Thread(new Runnable(...)).start())因为我不知道如何正确地将它们保存到Threads[]数组中,因为虽然ThreadsWorker会保存threads[i] = new Threads(),但某些线程可能会完成,然后会与数组索引发生冲突.
由于匿名调用,我threadsCount现在使用变量并在线程体中开始递增它,并在线程体端减少(使用synchronized).好的,它工作正常,我的唯一方法是使用while()循环来检查threadsCount == 0进度是否完成.
我认为这是C风格但不是Java风格:)所以,你能帮我用Java方式做吗?
我已经通过“蛋糕烘焙测试服”生成了测试服,并为我的应用程序使用了 localhost/test.php。因此,当我尝试运行其中一个测试时出现错误(其他测试有效):
Fatal error: Class 'ErrorHandler' not found in Z:\home\prodvigator\www\cake\libs\object.php on line 201
Run Code Online (Sandbox Code Playgroud)
这个模型和控制器是由脚手架生成的,我认为这个来源没有错误。
使用:CakePHP 1.3 最新的 SimpleTest
我有下一部分代码:
dCon = (HttpURLConnection) new URL(torrentFileDownloadLink).openConnection();
dCon.setRequestProperty("Cookie", "uid=" + cookies.get("uid") + ";pass=" + cookies.get("pass"));
dCon.setRequestMethod("GET");
dCon.setConnectTimeout(30000);
dCon.setDoOutput(true);
Run Code Online (Sandbox Code Playgroud)
但Wireshark显示请求方法是"POST".我做错了什么或者这只是一个错误?顺便说一句,getRequestMethod说方法是"GET",但实际上它是POST.
我有两个模型:User和Base.
用户模型:http: //pastebin.com/WdLzBkHJ
基本型号:http: //pastebin.com/tQrEUaSu
首先,我想在Base模型中考虑这种表示法:
@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
Run Code Online (Sandbox Code Playgroud)
它不起作用(在SQL Debug中显示Hibernate使用在MySQL中配置为可为空的不必要的列生成查询).请告诉我为什么?我究竟做错了什么?
主要问题是(解析后用户上传基础和字符串在MySQL表中插入的方法):http: //pastebin.com/yG3Mapze
插入非常慢.我有每行70000字符串的文件,我不能等到Hibernate将此字符串插入数据库.最大值我等了30分钟,这不是结束.如果我将使用这样的原始查询:
DB.execute("INSERT INTO bases (user_id,email,password) VALUES (1,'" + email.replaceAll("'", "\'") + "','" + password.replaceAll("'", "\'") + "')");
Run Code Online (Sandbox Code Playgroud)
代替
b.save();
Run Code Online (Sandbox Code Playgroud)
之后,在约10-20秒之后将70000个字符串插入DB完成.所以我无法理解问题出在哪里以及如何解决?
您还可以在上面的方法声明中看到此代码:
@NoTransaction
Run Code Online (Sandbox Code Playgroud)
如果我取消注释,那么我将收到此异常:
@ 689mbad1k请求POST/checker/uploadnewbase的内部服务器错误(500)
JPA错误发生JPA错误(JPA上下文未初始化.JPA实体管理器在应用程序中找到一个或多个使用@ javax.persistence.Entity批注注释的类时自动启动.):
play.exceptions.JPAException:未初始化JPA上下文.当在应用程序中找到使用@ javax.persistence.Entity批注注释的一个或多个类时,JPA实体管理器会自动启动.在play.db.jpa.JPA.get(JPA.java:22)在play.db.jpa.JPA.em(JPA.java:51)在play.db.jpa.JPQL.em(JPQL.java:16 )在play.db.jpa.JPQL.find(JPQL.java:44)在models.User.find(User.java)在controllers.Security.getUser(Security.java:30)在controllers.GlobalController.userStat(GlobalController的.java:21)在play.mvc.ActionInvoker.invoke(ActionInvoker.java:502)在play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:476)在play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:471)在在Invocation.HTTP请求play.mvc.ActionInvoker.handleBefores(ActionInvoker.java:320)在play.mvc.ActionInvoker.invoke(ActionInvoker.java:140)(玩!)
但是在Play手册中我们可以看到:"如果你想阻止Play完全启动任何事务,你可以用@ play.db.jpa.NoTransaction注释该方法.
要防止所有方法的事务,可以使用@play.db.jpa.NoTransaction注释Controller类."
所以我描述了三个问题:
我现在有这个解决方案:
rs = lState.executeQuery("SELECT FLOOR(RAND() * COUNT(*))
FROM bases
WHERE user_id = " + userId + " AND is_valid = 1");
rs.next();
count = rs.getInt(1);
rs = lState.executeQuery("SELECT id, server, server_port, server_ssl,
server_starttls, server_auth, email, password, auth_wholemail
FROM bases LIMIT " + count + ", 1");
Run Code Online (Sandbox Code Playgroud)
但它不起作用,因为FLOOR(RAND() * COUNT(*))不是返回id is_valid = 1.那么如何从MySQL whith where子句(其中is_valid = 1)快速选择随机条目?
我正在使用 Vuetify v-data-table组件。这里是:
<template>
<div>
<v-data-table
:headers="tableHeaders"
:items="items"
hide-actions
class="elevation-1"
>
<template slot="items" slot-scope="props">
<td>{{ props.item.name }}</td>
<td>{{ props.item.created_at }}</td>
<td>{{ props.item.updated_at }}</td>
</template>
</v-data-table>
<AddPlanButton/>
</div>
</template>
Run Code Online (Sandbox Code Playgroud)
这是我的标题:
data () {
return {
items: [],
tableHeaders: [
{ text: 'Name' },
{ text: 'Created at' },
{ text: 'Updated at' }
]
}
},
Run Code Online (Sandbox Code Playgroud)
我在控制台中收到下一个警告:
[Vuetify] Headers must have a value property that corresponds to a value in the v-model array in "v-data-table"
Run Code Online (Sandbox Code Playgroud)
我可以翻译,但我不能完全理解 - 我应该在我的代码中做什么?
java ×4
vuetify.js ×4
vue.js ×3
http ×2
breakpoints ×1
c ×1
cakephp ×1
gdb ×1
heroku ×1
hibernate ×1
javascript ×1
methods ×1
mingw ×1
mysql ×1
netbeans ×1
performance ×1
proxy ×1
random ×1
request ×1
socks ×1
unit-testing ×1
url ×1
where ×1