【问题标题】:twitter's typeahead not working after buildtwitter的typeahead在构建后不起作用
【发布时间】:2013-10-04 04:39:33
【问题描述】:

我正在使用主干构建一个应用程序,需要 yeoman 的 js。

我正在使用 twitter 的 typeaheadjs,它在开发版本中工作,但在构建后它不工作!它甚至没有抛出任何错误

this.collection.fetch({
    success: function (data) {
        $('#SerachProduct').typeahead({
            name: 'abc',
            valueKey: 'name',
            local: data.toJSON(),
            template: JST['app/scripts/templates/typeahead.ejs']
        });
    },
    error: fun() {..
    }
}

这里是github repo Github

这里的更新是该网站的链接application

$('#SerachProduct').typeahead({
  name: 'accounts',
  local: ['timtrueman', 'JakeHarding', 'vskarich']
});

尝试在控制台上运行它!它仍然无法正常工作!但它在开发版本中工作

注意: 我尝试在requirejs之前将jquery和typeahead lib直接添加到索引文件中,即使在控制台中运行上述语句后,typeahead甚至在生产版本中也不起作用,但是当我将它放在requirejs之后它起作用但只能通过控制台

【问题讨论】:

  • 你确定它只是提前输入不起作用吗?在过去的构建过程之后,我遇到了 Handlebars 和 JST 模板的问题。
  • 你休息一切正常
  • 在缩小过程中听起来好像出了点问题。

标签: javascript requirejs gruntjs yeoman typeahead.js


【解决方案1】:

问题出在 bootstrap 上!当我初始化项目时,yeoman 给我取了 bootstrap 2.3,它覆盖了预输入!我用最新版本替换了引导程序!现在它完美地工作了!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-03
    • 1970-01-01
    • 2015-03-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多