Comments (8)
https://github.com/P4sca1/nuxt-plugin-provide-types
from color-mode.
To reproduce run yarn
to install the dependencies, followed by yarn dev
.
Go to app.vue
and hover over $test
. It has a typing of any
.
Now edit nuxt.config.ts
and comment out modules
. $test
should now have the correct typing.
from color-mode.
@danielroe I found out that removing the following lines resolves the issue.
color-mode/src/runtime/types.ts
Lines 28 to 30 in f5253fe
Could you elaborate which interfaces are used by Nuxt Bridge / Nuxt 3 for TypeScript typings?
According to the docs, the following declaration would be sufficient for Nuxt 3:
export interface ColorModeInstance {
preference: string;
value: string;
unknown: boolean;
forced: boolean;
}
declare module '#app' {
interface NuxtApp {
$colorMode: ColorModeInstance
}
}
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$colorMode: ColorModeInstance
}
}
export { }
I don't really know what all the other definitions are for in the types.d.ts
file.
from color-mode.
@danielroe @pi0 Could you have a look at this? This issue really kills the DX in Nuxt 3.
from color-mode.
This seems to be working fine for me using your reproduction + latest color mode + rc113.
"devDependencies": {
"@nuxtjs/color-mode": "latest",
"nuxt": "3.0.0-rc.13"
}
Are you still experiencing this?
from color-mode.
@danielroe I upgraded the dependencies in https://github.com/P4sca1/nuxt-plugin-provide-types and still experience the issue.
However I noticed the following: When you just loaded VSCode, or restarted the Vue server (Volar: Restart Vue Server), the correct typing for $test
will be there for a few seconds. After a few seconds, when you reopen the file app.vue
, the typings will be gone and $test
will be typed any
.
from color-mode.
Bildschirmaufnahme.2022-11-12.um.11.33.37.mov
from color-mode.
This is no longer reproducible.
from color-mode.
Related Issues (20)
- Dark theme cannot be loaded
- allow disabling css transitions while changing color scheme
- Get color-theme while server render HOT 2
- Forced color mode incorrect timing
- Adding class "theme-red" to <html> breaks color-mode
- Load color-mode already in spa template
- helper.getColorScheme is not a function error when trying to use the module HOT 7
- Can I use only data value?
- Selected Color dosn't save on LocalStorage
- Question about demo asset regarding license HOT 2
- On light mode background-color is transparent HOT 1
- Document how to force color mode dynamically (e.g. from a useFetch response) HOT 6
- Color of element stuck in 1 color.
- Reactive `useColorMode()` value HOT 1
- tailwind module integration breaks dark mode HOT 7
- Support set html attribute HOT 1
- Why is my nuxt app color mode configuration not working with the "prefrence : light" ? HOT 3
- Should there be a way to force a color mode in the root of the app?
- How to set a theme in arc design
- feat: link script in head for CSP 'self' compliance in v3 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from color-mode.