Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hello,
I am familiar with vue.js. (not an expert, but..).
How can I use a component "myCoolButton" from a file1.html inside file2.html (for example).

I tried several things, without succes.

You must be logged in to vote

Replies: 3 comments · 5 replies

Comment options

Hello @nervusdm

You need to use slots for it. I guess it is the best solution(https://vuejs.org/guide/components/slots.html#slot-content-and-outlet)

You must be logged in to vote
0 replies
Comment options

Hello @VasylHulpak Could you, if it does not bother you, give me a quick example in petite vue ?

You must be logged in to vote
2 replies
@VasylHulpak
Comment options

Hello, sure. In few minutes i will give you the example

@VasylHulpak
Comment options

@nervusdm
There is not implementation yet.
I saw only a discussion. I am working on another stuff so will not be able to fork the repo to implement.

Sorry for that

Comment options

Hello, I am familiar with vue.js. (not an expert, but..). How can I use a component "myCoolButton" from a file1.html inside file2.html (for example).

I tried several things, without succes.

in petite-vue, component is just a function, so you put myCoolButton in a javascript file, then include it in file2.html's script part

You must be logged in to vote
3 replies
@nervusdm
Comment options

I may be wrong, but not really,

Look about slot.

@sqllyw
Comment options

there is no slot in petite-vue, only a bare-bone component:
https://github.com/vuejs/petite-vue#components

@jikkuatwork
Comment options

Thats sad. Wish there was a way to nest components

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.