我已经将bootstrap更新到版本3.除了由simple_form gem生成的表单外,一切正常.我不知道如何将这两者结合在一起.我在github项目存储库中找不到任何有用的建议.那么有人为我提供解决方案吗?
ruby-on-rails simple-form twitter-bootstrap twitter-bootstrap-3
我得到了一个非常简单的反应组件,具有以下功能:
componentDidMount() {
window.scrollTo(0, 0)
}
Run Code Online (Sandbox Code Playgroud)
看来你做不了什么
window.scrollTo = jest.fn()
Run Code Online (Sandbox Code Playgroud)
窥探scrollTo功能.
因此,我想知道监视这个函数的最佳方法是什么,并断言它已经在我的测试中使用过.
谢谢
PropTypes我想知道在 ES6 中导入 React 的两种名为 import ( , )的方法中哪一种Component是最好的。
import React, {PropTypes, Component} from 'react';
Run Code Online (Sandbox Code Playgroud)
这将节省大量输入,特别是在有大量道具需要验证的组件上。
import React form 'react';
Run Code Online (Sandbox Code Playgroud)
然后像React.Component我想使用它们时那样调用它们。
两种方法之间是否存在性能差异,或者我应该选择我更喜欢的风格?
Right now my bootstrap css version is v2.3.2 with following gem
gem 'bootstrap-sass', '~> 2.3.2.1'
Run Code Online (Sandbox Code Playgroud)
I tried to upgrade it by using following configuration
gem 'bootstrap-sass', git: 'https://github.com/thomas-mcdonald/bootstrap-sass.git', branch: '3'
Run Code Online (Sandbox Code Playgroud)
But after restarting the server and everything the version remained the same
所以我试过bundle exec rake convert,也许它可以解决问题
但它一直在投掷
Don't know how to build task 'convert'
Run Code Online (Sandbox Code Playgroud)
那么有谁知道如何将bootstrap v3实现到我的rails项目中?
javascript ×2
babeljs ×1
css ×1
import ×1
jestjs ×1
mocking ×1
reactjs ×1
ruby ×1
simple-form ×1
spy ×1
unit-testing ×1