我在完成React项目演示时遇到了问题.大多数问题源于我试图在他们使用Javascript的Typescript中实现它.这个要点是我的app.tsx文件.
https://gist.github.com/jjuel/59eed01cccca0a7b4f486181f2a14c6c
当我运行这个时,我得到与界面有关的错误.
./app/app.tsx(38,17)中的错误:错误TS2324:类型'IntrinsicAttributes&IntrinsicClassAttributes&AppProps&{children?:ReactElement | ...'中缺少属性'human'.
./app/app.tsx(38,17)中的错误:错误TS2324:类型'IntrinsicAttributes&IntrinsicClassAttributes&AppProps&{children?:ReactElement | ...'中缺少属性'stores'.webpack:bundle现在是VALID.
我不知道这是怎么回事.有谁知道我的问题是什么?谢谢!
我遇到了 webpack 告诉我的问题:
./app/app.tsx (4,25) 中的错误:错误 TS2307:找不到模块“./sample-data”。
我的进口看起来像这样:
import * as React from 'react';
import * as ReactDom from 'react-dom';
import { InboxPane } from './components/Inbox';
import * as Samples from './sample-data';
Run Code Online (Sandbox Code Playgroud)
最后,这是我尝试导入的 sample-data.js 文件:
module.exports = {
"humans": {
"John Smith" : {
"conversations": [
{
"who": "bot",
"text": "Hello, can I take your order?",
"time": new Date(2016, 4, 5, 15, 10, 0, 0)
},
{
"who": "human",
"text": "Can I have a small meat-lovers pizza?",
"time": new Date(2016, …Run Code Online (Sandbox Code Playgroud) 我正在努力找出os.Open的问题。使用os.Open时,我一直收到“没有这样的文件或目录”错误。在名为template的文件夹上打开。因此,我的文件夹MVCApp中包含bin pkg src和模板。然后我在src文件夹中有main。所以我有这段代码:
basePath := "templates"
templateFolder, err := os.Open(basePath)
if err != nil {
log.Fatal(err)
}
defer templateFolder.Close()
Run Code Online (Sandbox Code Playgroud)
我认为这与我在开放环境中使用的basePath有关,但是我无法弄清楚我需要如何为它们找到此目录添加“模板”的开头。我敢肯定,这是一个简单的解决方法,但这让我感到困惑。任何帮助将不胜感激。
所以我试图将一些VB代码转换为C#.属性定义如下:
Public Overridable ReadOnly Property [Error]() As String Implements System.ComponentModel.IDataErrorInfo.Error
Run Code Online (Sandbox Code Playgroud)
我看到的转换使它看起来像这样:
public virtual string Error
Run Code Online (Sandbox Code Playgroud)
现在我理解这里的一切,除了它忽略了Implements行.这在C#中是不是必要的吗?