小编use*_*578的帖子

Angular2 UL/LI JSON-tree在ngFor中递归

我想将JSON树转换为Angular2中的无序列表.我知道Angular1的递归指令解决方案,我很确定Angular2中的解决方案也是递归的.

    [
        {name:"parent1", subnodes:[]},
        {name:"parent2", 
            subnodes:[
                    {name:"parent2_child1", subnodes:[]}
                 ],
        {name:"parent3", 
            subnodes:[
                    {name:"parent3_child1", 
                        subnodes:[
                                {name:"parent3_child1_child1", subnodes:[]}
                             ]
                    }
                 ]
        }
    ]
Run Code Online (Sandbox Code Playgroud)

这个无序的清单

<ul>
    <li>parent1</li>
    <li>parent2
        <ul>
            <li>parent2_child1</li>
        </ul>
    </li>
    <li>parent3
        <ul>
            <li>parent3_child1
                <ul>
                    <li>parent3_child1_child1</li>
                </ul>
            </li>
        </ul>
    </li>
</ul>
Run Code Online (Sandbox Code Playgroud)

使用Angular2和ngFor.有人有个主意吗?

tree json html-lists angular

23
推荐指数
2
解决办法
1万
查看次数

忽略 package.json 中单个包的对等依赖性检查

我尝试从 NPM 7 的对等依赖项检查中排除包react-virtualized。我知道我可以单独安装该包

npm install react-virtualized --legacy-peer-deps

...但我的目标是使用 npm install 安装所有软件包,并且不应检查此软件包的对等依赖关系。那可能吗?

我会接受任何向我展示如何操作 package.json 的答案,以便新的npm 安装运行时不会出现对等依赖错误。我有以下 package.json:

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-redux": "^7.2.4",
    "react-router": "^5.2.0",
    "react-router-dom": "^5.2.0",
    "react-beautiful-dnd": "^13.1.0",
    "react-device-detect": "^1.11.14",
    "react-markdown": "^7.0.0",
    "react-resize-detector": "^6.7.1",
    "react-virtualized": "^9.22.3"
  }  
}
Run Code Online (Sandbox Code Playgroud)

npm npm-install peer-dependencies

14
推荐指数
2
解决办法
7397
查看次数

Netbeans 8快捷方式,用于显示参数和显示返回值

Netbeans 8中显示方法参数和方法返回值的快捷方式是什么?

netbeans keyboard-shortcuts

4
推荐指数
1
解决办法
1844
查看次数

React-Native 自动向下滚动

我有一个应用程序,其中有一个 ScrollView 和一个按钮,里面有一个长文本:

return (
    <ScrollView>
        <Button onPress={slowlyScrollDown} title="Slowly scroll a bit down..." />
        <Text>
              [ Very long text here where user has to scroll ]
        </Text>
    </ScrollView>
)

Run Code Online (Sandbox Code Playgroud)

当用户按下按钮时,我想慢慢向下滚动一点,这样他就可以看到文本的前 5-10 行。

我会接受任何提供一段代码的答案,我可以如何实现它。

scrollview react-native

4
推荐指数
1
解决办法
3418
查看次数

将 json 数组插入 postgres json []

如何将数组 ["a","b","c"] 插入到 test 中?

create table test( f json [] );
Run Code Online (Sandbox Code Playgroud)

我试过

insert into test (f) values('{\"a\",\"b\",\"c\"}');
Run Code Online (Sandbox Code Playgroud)

但是当我选择它时,会显示转义反斜杠。如果不逃避它根本不起作用。(令牌“a”无效)

select * from test;

f
----
{"\"a\"","\"b\"","\"c\""}
Run Code Online (Sandbox Code Playgroud)

postgresql json insert

3
推荐指数
1
解决办法
8070
查看次数