我已经安装了 twitter 的 typeahead 插件,但我无法达到工作限制。
我把它放在两个不同的位置:
$('input.typeahead').typeahead({
limit: 5,
hint: true,
highlight: false,
minLength: 1
}, {
name: 'country',
displayKey: 'value',
source: substringMatcher(countries)
Run Code Online (Sandbox Code Playgroud)
我也试过这个:
$('input.typeahead').typeahead({
hint: true,
highlight: false,
minLength: 1
}, {
limit: 5,
name: 'country',
displayKey: 'value',
source: substringMatcher(countries)
Run Code Online (Sandbox Code Playgroud)
我的其余代码:
var substringMatcher = function (strs) {
return function findMatches(q, cb) {
var matches, substringRegex;
// an array that will be populated with substring matches
matches = [];
// regex used to determine if a string contains the substring …Run Code Online (Sandbox Code Playgroud) 出于某种原因,当我尝试使用webpack进行压缩时,我的webdriverio无法找到/ protocol和/ command目录.
它给了我这个错误:
Uncaught Error: ENOENT: no such file or directory, scandir '/protocol'
at Object.fs.readdirSync (fs.js:871:18)
at getImplementedCommands (chrome-extension://chldbooigfagkknimlieldoieoahlncn/vendor.npm.js:119349:39)
at Object.<anonymous> (chrome-extension://chldbooigfagkknimlieldoieoahlncn/vendor.npm.js:80520:66)
at __webpack_require__ (chrome-extension://chldbooigfagkknimlieldoieoahlncn/manifest.js:51:30)
at Object.618 (chrome-extension://chldbooigfagkknimlieldoieoahlncn/index.js:1445:20)
at __webpack_require__ (chrome-extension://chldbooigfagkknimlieldoieoahlncn/manifest.js:51:30)
at Object.617 (chrome-extension://chldbooigfagkknimlieldoieoahlncn/index.js:1409:16)
at __webpack_require__ (chrome-extension://chldbooigfagkknimlieldoieoahlncn/manifest.js:51:30)
at Object.616 (chrome-extension://chldbooigfagkknimlieldoieoahlncn/index.js:1329:14)
at __webpack_require__ (chrome-extension://chldbooigfagkknimlieldoieoahlncn/manifest.js:51:30)
Run Code Online (Sandbox Code Playgroud)
有问题的代码是:
var dir = _path2.default.join(__dirname, '..', commandType);
var files = _fs2.default.readdirSync(dir);
Run Code Online (Sandbox Code Playgroud)
Webpack有两个名为命令和协议的目录,压缩时无法找到它们.
这是我的webpack配置:
module.exports = {
// common options
// the grunt-webpack merges the "options" objects with each task config (nested)
options: {
stats: {
timings: …Run Code Online (Sandbox Code Playgroud) 我尝试了许多不同的东西,比如升级gradle,但我无法解决这个问题.我无法得到gradle:
./gradlew build --stacktrace
:......
:app:compileDebugJava
An exception has occurred in the compiler (1.8.0_25). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for bolts.Task not found
:app:compileDebugJava FAILED
FAILURE: Build failed with an exception.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJava'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
at …Run Code Online (Sandbox Code Playgroud) android ×1
css ×1
gradle ×1
gradlew ×1
javascript ×1
source-maps ×1
twitter ×1
typeahead ×1
webdriver-io ×1
webpack ×1