我正在认真寻找这个代码......我是新程序员.
实际上我想用旗帜制作所有日期,这些日期都是特定年份的星期日.
拜托,我急切地等待你的回应....
我在一个字符串中有3个id:
let $x="6,3,5"
Run Code Online (Sandbox Code Playgroud)
我想从所有颜色信息,tbl_color其中颜色id是
6,3和5.
我做了这个查询,但是没有用.这有什么问题?
$sql=" SELECT * FROM tbl_color WHERE color_id IN(".explode(',',$x).")
Run Code Online (Sandbox Code Playgroud)
请提出正确的查询
所以我在我的 Gatsby 应用程序中使用 React 的上下文 API(基本上是用 React 编写的)来处理用户身份验证。我有两个使用该上下文的组件:dashboard和navBar。当我尝试登录和注销时, my 的navBar行为会根据 my 有所不同userContext,但 mydashboard不会响应。它是否与结构有关,例如navBar是 的直接“子级” layout,但dashboard不是?我认为不是,毕竟,这就是为什么我使用contextAPIthen 只是传递一个普通的道具。
以下是代码:
//layout.js
import React, { useContext, useState, createContext } from "react"
import Navbar from "../components/navBar"
import {monitorAuth} from "../firebase/firebaseService"
export const UserStateContext = createContext(null)
export const SetUserContext = createContext()
const Layout = ({ children }) => {
const [user, setUser] = useState()
console.log(user)
monitorAuth(setUser)// everytime a layout …Run Code Online (Sandbox Code Playgroud) 什么工作:
什么不起作用:
我尝试过的:
题:
内容/index.mdx:
---
title: Main Content English
slug: /main-content/
---
<Hero># This is a test, but never gets transformed</Hero>
<Section># In Section Headline</Section>
# ABC
Officia cillum _asdasd_ et duis dolor occaecat velit culpa. Cillum eu sint adipisicing labore incididunt nostrud tempor fugiat. Occaecat ex id fugiat laborum ullamco. Deserunt sint quis aliqua …Run Code Online (Sandbox Code Playgroud) I'm new to using Ramda so when I performed a map function (in my gatsby app) on an array of blog posts, within that map I used simple if statements. But I want to do this the right way, using Ramda all the way through, but I'm finding its many options overwhelming. I've definitely found and tried many examples from StackOverflow and elsewhere and have been able to grab the categories but not the whole blog post based on those …
我正在制作一个小型音频播放器应用程序并尝试将我的反应类组件转换为功能组件。
类组件的原始代码在这里:
class Player extends React.Component {
constructor(){
super()
this.state = {
tracks: [
{title: "first track", data: track1},
{title: "second track", data: track2},
{title: "third track", data: track3},
],
currentTrack: 0,
}
}
changeData(trackIndex){
this.setState({currentTrack: trackIndex})
}
render(){
return <div style={{color: this.props.color}}>
<h1>Player</h1>
<AudioPlayer
src= {this.state.tracks[this.state.currentTrack].data}
/>
<div style={{color: "green"}}>
<ul>
{this.state.tracks.map((trackElem, index) => (
<li onClick={()=> this.changeData(index)}>{trackElem.title}</li>
))}
</ul>
</div>
</div>
}
}
Run Code Online (Sandbox Code Playgroud)
我尝试了以下转换:
const Player2 = () => {
const Items = [
{title: "first track", data: …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 GSAP CSS 规则插件来定位伪选择器并对其进行动画处理。问题是它没有检测到它并记录GSAP target undefined not found到控制台。我尝试通过将元素记录到控制台来获取该元素,但它也是未定义的。
这是我的使用方法:
import { gsap } from "gsap"
import { CSSRulePlugin } from "gsap/CSSRulePlugin"
const IndexPage = () => {
useEffect(() => {
gsap.registerPlugin(CSSRulePlugin);
const titleRule = CSSRulePlugin.getRule(
"span.landing__title--span::after"
)
// Log titleRule
console.log(titleRule). // undefined
const tl = gsap.timeline();
tl.to(
titleRule,
{
cssRule: {
scaleY: 0,
duration: 1
},
}
)
},[])
return (
<div>
<span className="landing__title--span">Hey there</span>
</div>
)
}
export default IndexPage
Run Code Online (Sandbox Code Playgroud)
我做错了什么以及如何纠正?提前致谢
我从 GraphQL 查询中提取数据并通过 React 应用程序中的数组进行映射,我可以看到控制台是否记录了所有数据都按请求存在的数组,但是当我映射它时,我什么也没有显示我的屏幕,没有错误,它不会生成任何 HTML 元素或任何内容,尽管与我迄今为止所做的所有其他数组映射类似。
我的组件的映射部分如下:
const CareerFeed = React.forwardRef((props, ref) => {
return (
<CareerFeedWrapper ref={ref}>
<Container width={14}>
{console.log(props.array)}
{props.array.map((item, index) => {
<CareerItem key={index}>
{item.title}
</CareerItem>
})}
</Container>
</CareerFeedWrapper>
)
})
Run Code Online (Sandbox Code Playgroud) javascript ×5
reactjs ×5
assembly ×1
css ×1
date ×1
gatsby ×1
graphql ×1
gsap ×1
java ×1
linux ×1
mdxjs ×1
mysql ×1
php ×1
ramda.js ×1
react-class-based-component ×1
react-hooks ×1
render ×1
routines ×1
typescript ×1