Skip to content

Commit

Permalink
docs: add file extension to dynamic import of theme switching example (
Browse files Browse the repository at this point in the history
  • Loading branch information
wattachai-lseg authored May 11, 2023
1 parent ab834dc commit fd267b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion documents/src/pages/build-app/theme-switching.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ In the same directory, create a theme loader that dynamically imports the theme
// theme-loader.js
export function loadTheme() {
const theme = document.body.getAttribute("theme"); // value can be `light` or `dark`
return import(`./theme.${theme}`); // provided that theme.light.js & theme.dark.js are in the same directory
return import(`./theme.${theme}.js`); // provided that theme.light.js & theme.dark.js are in the same directory
}
```

Expand Down

0 comments on commit fd267b3

Please sign in to comment.