我正在尝试在我的反应网站上设置Google Analytics,并且遇到了一些软件包,但是没有一个软件包具有我在示例方面的设置.希望有人可以对此有所了解.
我正在看的包是,react-ga.
我的渲染方法index.js看起来像这样.
React.render((
<Router history={createBrowserHistory()}>
<Route path="/" component={App}>
<IndexRoute component={Home} onLeave={closeHeader}/>
<Route path="/about" component={About} onLeave={closeHeader}/>
<Route path="/gallery" component={Gallery} onLeave={closeHeader}/>
<Route path="/contact-us" component={Contact} onLeave={closeHeader}>
<Route path="/contact-us/:service" component={Contact} onLeave={closeHeader}/>
</Route>
<Route path="/privacy-policy" component={PrivacyPolicy} onLeave={closeHeader} />
<Route path="/feedback" component={Feedback} onLeave={closeHeader} />
</Route>
<Route path="*" component={NoMatch} onLeave={closeHeader}/>
</Router>), document.getElementById('root'));
Run Code Online (Sandbox Code Playgroud) 我正在尝试在当前使用React Router的ReactJS应用程序中加载facebook评论插件.
如果我把facebook初始化代码放在我的页面的componentDidMount()方法中,它会第一次加载.但是在转到另一个页面然后又回到它之后,它根本不加载插件.
我是否需要做些什么才能让它一直出现?
我想我需要删除facebook init并重新重新初始化.但这感觉不对.
有什么建议?下面是我的组件代码
```
import React, { Component } from 'react';
import SlidingPanels from '../components/SlidingPanels';
export class Feedback extends Component {
constructor() {
super();
}
componentDidMount() {
$(window).scrollTo(0, '0.5s');
window.fbAsyncInit = function() {
FB.init({
appId : '115517331888071',
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse social plugins on this page
version : 'v2.5' // use version 2.1
});
}.bind(this);
// Load the SDK asynchronously
(function(d, …Run Code Online (Sandbox Code Playgroud) 我有这个 HTML
<div class="link">
<i class="icon" />
<div class="text-wrapper">
<span class="label">Some label which can span at most 2 lines</span>
<span class="subtext">(optional)</span>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
一种显示方式是:
请注意标签如何换行到第二行,而潜台词则在其后面。
另一种显示方式是:
注意这里的标签不够长,无法换行,但潜台词仍然在第二行。
谁能建议我如何仅使用 HTML/CSS 实现上述目标?随意忽略解决方案中的图标。我已经有了。提前致谢。
我到目前为止的代码......
.link {
position: relative;
font-size: 0.875rem;
padding-left: 26px;
text-align: left;
line-height: 1.25rem;
}
.icon {
padding: 0;
width: 18px;
height: 18px;
font-size: 18px;
border-radius: 50%;
transform: translateY(2px);
position: absolute;
top: 0;
left: 0;
}
.label {
margin-right: 4px;
color: #007dbb;
}
.subtext { color: #686868; }
Run Code Online (Sandbox Code Playgroud) 我根据firebase的说明添加了TXT记录.还有crazydomains支持验证设置,但我仍然得到发现的意外TXT记录.继续关注变化.验证步骤中的消息.
任何人都有使用crazydomains的经验吗?我已经阅读了另一篇针对NAMECHEAP的类似帖子,但我没有看到我如何使用crazydomains将'@'添加到Host字段中.
这是我对crazydomains的设置.