我正在尝试为Exokit安装必要的依赖项,但是却收到与Python语法错误有关的错误。
这是我想尝试在浏览器中涉及VR的新内容。我已经从他们的github重新克隆了存储库,并直接从他们的网站下载了。我按照对T的指示进行操作(其中只有4个笑声)。
I have not yet touched the code and this is the error that I am getting.
Austin@DESKTOP-UD2R1O4 MINGW64 ~/exokit (master)
$ npm install
> raw-buffer@0.0.19 install C:\Users\Austin\exokit\node_modules\raw-buffer
> node-gyp rebuild
C:\Users\Austin\exokit\node_modules\raw-buffer>if not defined
npm_config_node_gyp (node "C:\Program
Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-
bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node
"C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\Austin\Anaconda3\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" …Run Code Online (Sandbox Code Playgroud) 我目前有“作品”,但是每个参数都取决于最后一个。我的目标是允许用户使用任意数量的搜索字段来过滤帖子,但似乎无法将我的头放在如何实际执行上。
搜索字段的代码:
import React from "react";
import { Input, DropDown } from "../Form";
import "./index.css";
function Sidebar(props) {
return (
<div className="sidebar-container">
<p>Search Posts: {props.carMake}</p>
<div className="field-wrap">
<Input
value={props.carMake}
onChange={props.handleInputChange}
name="carMake"
type="text"
placeholder="Manufacturer"
/>
</div>
<div className="field-wrap">
<Input
value={props.carModel}
onChange={props.handleInputChange}
disabled={!props.carMake}
name="carModel"
type="text"
placeholder="Model"
/>
</div>
<div className="field-wrap">
<Input
disabled={!props.carModel || !props.carMake}
value={props.carYear}
onChange={props.handleInputChange}
name="carYear"
type="text"
placeholder="Year"
/>
</div>
<div className="field-wrap">
<DropDown
//disabled={!props.carModel || !props.carMake || !props.carYear}
value={props.category}
onChange={props.handleInputChange}
name="category"
type="text"
id="category"
>
<option>Select a category...</option>
<option>Brakes</option>
<option>Drivetrain</option>
<option>Engine</option>
<option>Exhaust</option> …Run Code Online (Sandbox Code Playgroud) 我在Codepen上遇到了以下代码片段:
const { Component, createElement, PropTypes } = React;
const source = `<p>Hello, my name is {{name}}. I work for {{employer}}. I have {{kids.length}} kids:</p> <ul>{{#kids}}<li>{{name}} is {{age}}</li>{{/kids}}</ul>`;
const template = Handlebars.compile( source );
class StarshipEnterprise extends Component {
static propTypes = {
name: PropTypes.string,
employer: PropTypes.string,
kids: PropTypes.arrayOf( PropTypes.object ),
};
static defaultProps = {
name: "Data",
employer: "United Federation of Planets",
kids: [
{
name: "Lal",
age: "2"
},
]
};
render () {
return <div …Run Code Online (Sandbox Code Playgroud) 我已经完成了所有设置,我只是不知道如何通过react-particles-js创建的元素作为背景.
这是我到目前为止的代码:
import React from "react";
import { BrowserRouter as Router, Route } from "react-router-dom";
import NavTabs from "./components/NavTabs";
import Home from "./components/pages/Home";
import About from "./components/pages/About";
import Contact from "./components/pages/Contact";
import ParticlesContainer from "./components/ParticlesContainer";
function App() {
return (
<ParticlesContainer>
<Router>
<div>
<NavTabs />
<Route exact path="/" component={Home} />
<Route exact path="/about" component={About} />
<Route path="/contact" component={Contact} />
</div>
</Router>
</ParticlesContainer>
);
}
export default App;
Run Code Online (Sandbox Code Playgroud)
但是,没有一个内容显示; 只有canvas元素是可见的,而其余部分似乎根本不呈现.
编辑:这是ParticleContainer代码:
import React, {Component} from 'react';
import Particles from 'react-particles-js';
class …Run Code Online (Sandbox Code Playgroud) 例如,这段代码片段:
React.createElement(
"h1",
null,
"Shopping List for ",
props.name
),
Run Code Online (Sandbox Code Playgroud)
null 值代表什么,或者可以用来做什么?