Skip to content

Commit

Permalink
Manually control the loading of JS resources (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
youcaiyouyoucai authored Sep 23, 2024
1 parent 2e71160 commit a20e88b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AntDesign.Charts/wwwroot/AntDesign.Charts.lib.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function loadScriptAndStyle() {
const localJS = "_content/AntDesign.Charts/g2plot.min.js";
const cdnFlag = document.querySelector('[use-ant-design-charts-cdn]');

if (!document.querySelector(`[src="${interopJS}"]`)) {
if (!document.querySelector(`[src="${interopJS}"]`) && !document.querySelector('[no-antblazor-charts-js]')) {
const chartJS = cdnFlag ? cdnJS : localJS;
const chartScript = document.createElement('script');
chartScript.setAttribute('src', chartJS);
Expand All @@ -29,4 +29,4 @@ function loadScriptAndStyle() {
interopScript.setAttribute('src', interopJS);
chartScript.after(interopScript);
}
}
}

0 comments on commit a20e88b

Please sign in to comment.