GithubHelp home page GithubHelp logo

Comments (10)

pi0 avatar pi0 commented on June 8, 2024 2

@alvarosaburido Seems related to new build improvements. Would you please upgrade to 0.3.3?

from components.

Krutie avatar Krutie commented on June 8, 2024 1

@alvarosaburido In the sandbox, I see that there are two files with the same name, ComponentC (one .js and other .vue); while using this module (as of v0.3.0), component-names are based on their filenames. (Ref: https://github.com/nuxt/components#nested-components)

I'd suggest you try,

  • changing ComponentC.js file-name to something different, like component-c-script.js,
  • then update script tag in ComponentC to reflect this new name, like, <script src="./component-c-script.js"></script>

...and after that, <ComponentC/> should render just fine.

from components.

alvarosabu avatar alvarosabu commented on June 8, 2024 1

changing ComponentC.js file-name to something different, like component-c-script.js,
then update script tag in ComponentC to reflect this new name, like, <script src="./component-c-script.js"></script>

@Krutie Thanks for the answer, indeed works the way you suggested, seems like if you decide to go for separation of concerns approach you can't name the .js file the same as the .vue template.

from components.

alvarosabu avatar alvarosabu commented on June 8, 2024

Confirmed. template or render function not defined.

Sandbox link --> https://codesandbox.io/s/nuxt-components-p4bze?file=/components/component-c/ComponentC.js

from components.

cataline66 avatar cataline66 commented on June 8, 2024

guys, do not escape the scope of my question hehe

which is when we want to represent a component through a folder and inside the folder an ‘index.vue’

and not when we try to import a ‘.js’ file inside a component, if this is a problem, they should open another issue

from components.

alvarosabu avatar alvarosabu commented on June 8, 2024

so that we can put other things inside regarding the component, for example, a spec.js

Hey @cataline974, then I'm confused by this phrase, using a separate script is just separation of concerns and it's inside of the scope of 'does not work with components in folder format' ,

├── src
│   └── components
│         └── ButtonStyled
│           └── index.vue
│           └── ButtonStyled.js

But fair enough #29 ✌️

from components.

cataline66 avatar cataline66 commented on June 8, 2024

@alvarosaburido @pi0

in my question I do not include ButtonStyled.js as file JS... but this ButtonStyled as folder.

the component name must be the folder name, this is the natural behavior in normal components and pages.

see this image

this is the normal mode I mean, which works well.
see this image

from components.

pi0 avatar pi0 commented on June 8, 2024

Hi. Support for index files, added with v0.3.2 (#30) :)

from components.

cataline66 avatar cataline66 commented on June 8, 2024

@pi0 it was not solved

"@nuxt/components": "^0.3.2"

https://image.prntscr.com/image/ljZjgajkTamTvZni36Wz4g.png

https://image.prntscr.com/image/bTToPYb2QMSb9EwkEvTVnQ.png

from components.

cataline66 avatar cataline66 commented on June 8, 2024

works fine, thank you very much!

from components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.