小编dom*_*dom的帖子

Twitter 的提前输入限制不起作用

我已经安装了 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)

javascript css twitter typeahead

5
推荐指数
2
解决办法
5468
查看次数

使用webpack压缩时的Webdriverio问题

出于某种原因,当我尝试使用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)

source-maps webpack webdriver-io

5
推荐指数
0
解决办法
260
查看次数

不能跑gradle

我尝试了许多不同的东西,比如升级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 gradle gradlew android-gradle-plugin

4
推荐指数
1
解决办法
1587
查看次数