Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法获取组件实例 #326

Closed
Halecoder opened this issue Jun 20, 2024 · 2 comments
Closed

无法获取组件实例 #326

Halecoder opened this issue Jun 20, 2024 · 2 comments

Comments

@Halecoder
Copy link

<RelationGraph ref="graphRef" :options="graphOptions">
const graphRef = ref<RelationGraphComponent>();
onMounted(() => {
  init();
  setGraphData();
});

const setGraphData = async () => {
  const __graph_json_data: RGJsonData = rdata.value;
  const graphInstance = graphRef.value!.getInstance();
  await graphInstance.setJsonData(__graph_json_data);
};

不知道怎们回事,使用json文件的数据的时候可以,我从数据库查询的数据好像不行
image

@Halecoder
Copy link
Author

似乎那个时候还没渲染

@Halecoder
Copy link
Author

已解决,使用Json序列化
const __graph_json_data: RGJsonData = JSON.parse(JSON.stringify(rdata.value));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants