在jstree和Angular中不显示列表的解决方法可以包括以下步骤和代码示例:
import 'jstree';
import 'jstree/dist/themes/default/style.css';
import { Component, OnInit } from '@angular/core';
declare var $: any;
@Component({
selector: 'app-my-component',
templateUrl: './my-component.component.html',
styleUrls: ['./my-component.component.css']
})
export class MyComponent implements OnInit {
ngOnInit() {
// 初始化jstree
$('#jstree').jstree({
'core': {
'data': [
'item 1',
'item 2',
'item 3'
]
}
});
}
}
通过以上步骤和代码示例,可以在jstree和Angular中显示一个简单的列表。请注意,这只是一个基本的示例,根据实际需求可能需要进行更多的配置和定制。