79478749

Date: 2025-03-02 07:34:15
Score: 2.5
Natty:
Report link

Though I don't think Vueuse is the best solution for you. But I will still give you steps to make it and the suggested solution for you.

Check Steps

If you want to check why it doesn't work. you can follow these steps

  1. Check if you have install vueuse: npx nuxi@latest module add vueuse or npm i @vueuse/nuxt @vueuse/core
  2. Make sure you have defined it in config
// nuxt.config
export default defineNuxtConfig({
  modules: [
    '@vueuse/nuxt',
  ],
})
  1. Remove this part because you don't need to explicit import it
imports: {
    presets: [
      {
        from: "@vueuse/components",
        imports: ["UseWindowSize"], // I want to auto import this, I change to `UseWindowSize` or `*` still not working
      },
    ],
  },

But remember that no matter how you config, these methods are disabled for auto-import

You can always use them by explicitly import from @vueuse/core.

Better Solution

I think the purpose of your code is to define a div with height = window height - 265px. If that so, the better idea is using css to make it

height: calc(100% - 265px);

for different browser

/* Firefox */
height: -moz-calc(100% - 265px);
/* WebKit */
height: -webkit-calc(100% - 265px);
/* Opera */
height: -o-calc(100% - 265px);
/* Standard */
height: calc(100% - 265px);
Reasons:
  • Blacklisted phrase (2): still not working
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Alex Y