Comments (10)
@alvarosaburido Seems related to new build improvements. Would you please upgrade to 0.3.3
?
from components.
@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, likecomponent-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.
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.
Confirmed. template or render function not defined.
Sandbox link --> https://codesandbox.io/s/nuxt-components-p4bze?file=/components/component-c/ComponentC.js
from components.
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.
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.
@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
.
this is the normal mode I mean, which works well.
from components.
Hi. Support for index
files, added with v0.3.2 (#30) :)
from components.
@pi0 it was not solved
"@nuxt/components": "^0.3.2"
from components.
works fine, thank you very much!
from components.
Related Issues (20)
- Render function or template not defined in component HOT 9
- feat: get list of components at runtime HOT 5
- Dependency Dashboard
- Since updating from Nuxt 2.15.4 to 2.15.8, auto import components no longer work HOT 15
- Support custom resolvers HOT 1
- Problem after 2.1.8, app breaks if using lodash as plugin HOT 6
- Auto import components with nested directory cant use go to define on Visual Studio Code HOT 3
- Size after building is bigger with `components: true`
- Can a library module still import components manually? HOT 1
- Autoloading breaks when file exports multiple components at once.
- Nuxt build fails when using yarn berry plug-n-play mode
- Production build with directories marked with `isAsync: false` imports components asynchronously HOT 2
- A way to get an array of all the components that are autoloaded
- How to have typescript inference with this? HOT 1
- How to avoid nuxt-i18n error when you doing testing with Jest?
- SCSS variables not working
- Nuxt 3.0.0 support HOT 1
- Component automatically introduces the generated component name.
- Remove suffix (.component.vue)
- How to use Lazy loading component when auto imports for component is disabled? HOT 2
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 components.