-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Hi, Thank you for sharing such a wonderful lib.
I'd like to share the following info I noticed after using it.
- The following part will lead to error if this lib is used under vite. Maybe it‘s better to use "import" instead of require.
const {
enable: enableDarkMode,
disable: disableDarkMode,
} = require("darkreader");
- I have try to use as following in my app.vue
import Interpolator from "utils/vue-apply-darkmode.esm.js";
const isDarkMode = ref(false);
const isAutoMode = ref(false);
<Interpolator :dark="isDarkMode " :watch-system="isAutoMode ">
</Interpolator >
However, the props can be updated indeed but
activeDark
systemDark
will not be changed at all.
The dist file is referred as [1].
I’m not sure if there's any lacking of bding between the props and local varibales.
DevEnv : vue3, vite
- I checked the src and it looks watchSystem is never been used.
- currently I'm usng ref to access the component Interpolator directly, I can turn on and off for dark mode by following:
nightmodecomp.value.activeDark = false;
nightmodecomp.value.systemDark = true;
<Interpolator ref="nightmodecomp">
</Interpolator>
But it looks systemDark does not work corrctly.
I guess the related logic may not support to do so since it should be expected to use "watchSystem" actually.
Please correct me if I misunderstand anything, looking forward to your reply and help.
Thanks in advance.
[1] : https://github.com/valisoftworks/vue-apply-darkmode/blob/release/dist/vue-apply-darkmode.esm.js
Metadata
Metadata
Assignees
Labels
No labels