我正在尝试让我的网站在Google搜索上排名.我搜索了整个网络,文学上如何使这项工作.我看到,当我搜索时,它不使用描述元标记.当我查看我的源代码时,它使用og:description和description,这会导致任何类型的问题吗?是否应该像许多教程所暗示的那样进行重复数据删除?
<meta name="description" content="ELDE Cosmetics creates natural, fun and minimalistic skin care products for all skin types. Free from fragrance, essential oils, parabens.">
<meta name="keywords" content="Beauty, skincare, makeup, fragrance, perfume" />
<link rel="canonical" href="https://eldecosmetics.com/">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta property="og:type" content="website">
<meta property="og:title" content="ELDE Cosmetics — Natural & Organic Skin Care">
<meta property="og:description" content="ELDE Cosmetics creates natural, fun and minimalistic skin care products for all skin types. Free from fragrance, essential oils, parabens.">
<meta property="og:url" content="https://eldecosmetics.com/">
<meta property="og:site_name" content="ELDE">
Run Code Online (Sandbox Code Playgroud) 可能是有人在问这个问题,我一直在Github上找,但是找不到适合安装React Native Maps的解决方案...
不变违规:requireNativeComponent:在UIManager中找不到“ AIRMap”。
此错误位于AIRMap中(位于MapView.js:760)和MapView中(位于Home.js:118)。
"react-native": "^0.57.0-rc.4",
"react-native-maps": "^0.21.0",
Run Code Online (Sandbox Code Playgroud)
我试过了:
rm -rf ios android node_modules
npm install
react-native upgrade
react-native link
libAirMaps.a is added in Build Phases
AirGoogleMaps and AirMaps is added to Libraries
Run Code Online (Sandbox Code Playgroud)
遵循本指南,以在不使用CocoaPods的情况下手动添加iOS版Maps SDK:https://developers.google.com/maps/documentation/ios-sdk/start
新增@import GoogleMaps;和[GMSServices provideAPIKey:@"_YOUR_API_KEY_"];到AppDelegate.m
仍然出现相同的错误...
我尚未将其添加到package.json中,因为我不确定它要求的路径是什么?我在https://github.com/react-community/react-native-maps/blob/master/docs/installation.md找到了
{
"name": "your-app",
"scripts": {
"postinstall": "./node_modules/react-native-maps/enable-google-maps REPLACE_ME_RELATIVE_PATH_TO_GOOGLE_MAPS_INSTALL"
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用新的React Lazy和Suspense来创建一个后备加载组件.这很好用,但后备只显示几毫秒.有没有办法添加额外的延迟或最短时间,所以我可以在渲染下一个组件之前显示此组件的动画?
现在懒惰导入
const Home = lazy(() => import("./home"));
const Products = lazy(() => import("./home/products"));
Run Code Online (Sandbox Code Playgroud)
等待组件:
function WaitingComponent(Component) {
return props => (
<Suspense fallback={<Loading />}>
<Component {...props} />
</Suspense>
);
}
Run Code Online (Sandbox Code Playgroud)
我可以这样做吗?
const Home = lazy(() => {
setTimeout(import("./home"), 300);
});
Run Code Online (Sandbox Code Playgroud) 使用 Mapbox 删除和添加源/图层的正确方法是什么?data我正在使用 React,并且在更新源属性时遇到问题并收到错误。据我在 Mapbox 的文档中读到的内容,removeSource应该在再次添加之前将其删除,但它不适用于组件更新。
错误:已经存在具有此 ID 的源
componentDidMount() {
const { data } = this.props;
this.map = new mapboxgl.Map(config);
}
componentWillUnmount() {
const map = this.map;
map.remove();
map.removeControl(Draw, 'top-left');
}
shouldComponentUpdate(props, nextProps) {
const { data } = props;
if (JSON.stringify(data) !== JSON.stringify(nextProps.data)) {
return true;
}
return false;
}
componentDidUpdate(prevProps) {
const { data } = this.props;
if (JSON.stringify(data) !== JSON.stringify(prevProps.data)) {
this.fetchMap();
}
}
fetchMap() {
const map = this.map;
const { …Run Code Online (Sandbox Code Playgroud) 尝试使用JS Cookie制作 jQuery cookie 隐藏/显示框,但我不知何故无法使其工作。该框根本不会显示。我正在使用 Shopify。
#pop-up {
display: none;
}
Run Code Online (Sandbox Code Playgroud)
查询:
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
// if no cookie
if (!$.cookie('alert')) {
$( "#pop-up" ).show();
$("#hide").click(function() {
$( "#pop-up" ).slideUp( "slow" );
// set the cookie for 24 hours
var date = new Date();
date.setTime(date.getTime() + 24 * 60 * 60 * 1000);
$.cookie('alert', true, { expires: date });
});
}
});//]]>
</script>
Run Code Online (Sandbox Code Playgroud)
其余的部分:
<div id="pop-up">
<div id="center" class="box">
40% off today only<br>
<a id="hide" href="#">OK, thanks!</a>
</div> …Run Code Online (Sandbox Code Playgroud) 使用 react-native 制作一个简单的 firebase auth 应用程序。注册/登录工作正常,但我无法让登录正常工作。
loginUser = (email,password) => {
try{
firebase.auth().signInWithEmailAndPassword(email, password).then(function(user){
console.log(user)
})
}
catch(error){
console.log(error.toString())
}
}
signOutUser = () => firebase.auth.signOut();
Run Code Online (Sandbox Code Playgroud)
退出按钮很简单,如下所示:
<Button style={styles.button}
full
rounded
onPress={() => this.signOutUser()}
>
Run Code Online (Sandbox Code Playgroud) 我试图通过过滤来conversationId获取邮件的消息和回复,但每次都会收到错误:
Run Code Online (Sandbox Code Playgroud)Unexpected error value: { statusCode: 400, code: "BadRequest", message: "Invalid filter clause"
示例代码:
let response =
await client.api(`/me/messages?$filter=conversationId eq '${conversationId}'`)
.get();
Run Code Online (Sandbox Code Playgroud)
请求路径输出如下:
/me/messages?$filter=conversationId eq 'AAQkADJkZTNiN2ZlLTg2M2QtNGZjMC1hNDUxLTdlNjgzZDVjZDljMAAQAKVNpsZfVhlEtPFltSQuNJ8='
Run Code Online (Sandbox Code Playgroud)
在Graph Explorer中尝试完全相同的路径时,完全没有问题。
和空间有关系吗?我应该添加吗%20?
在我的 Shopify 博客中,我可以通过以下代码显示发布文章的日期:
{{ article.created_at | date: "%A, %-d. %B" }}
Run Code Online (Sandbox Code Playgroud)
它显示如下:1 月 22 日星期五。请在此处查看 Shopify 的日期说明。
是否可以制作一个脚本来检查日期是否是今天,然后显示 Shopify 日期脚本中插入的文本“今天”?还有“昨天”?
如果用户关闭div,我想记住缓存.我怎样才能做到这一点?我可以关闭div,但是当页面刷新时,它不会被保存.有没有办法做到这一点?
实时视图:http://eldeskin.com
HTML:
<div id="ps"><div class="close">
<button onClick="document.getElementById('ps').style.display = 'none';">x</button></div>
<div id="heart"></div><div class="text">PSSSST!<br><br>Følger du oss på <br><a target="_blank" href="http://instagram.com/eldeskincare">Instagram</a> og <a target="_blank" href="http://facebook.com/eldeskin">Facebook</a>?</div></div>
Run Code Online (Sandbox Code Playgroud)
CSS:
#ps {
position: fixed;
bottom: 30px;
right: 30px;
border: 1pt solid #000;
padding: 20px;
text-align: center;
text-transform: uppercase;
z-index: 99;
background: #FFF;
width: 300px;
}
#ps .text {
position: relative;
top: -30px;
}
#ps .text a {
font-size: 14px;
text-decoration: none;
color: #c19426;
font-weight: 500;
letter-spacing: 1px;
}
#ps .close {
text-align: right …Run Code Online (Sandbox Code Playgroud)