Uh oh!
There was an error while loading. Please reload this page.
feat(nuxt): add setLayout utility - #6826
Conversation
✅ Deploy Preview for nuxt3-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
HomWang
commented
Aug 22, 2022
Add Added document and composables |
HomWang
commented
Aug 22, 2022
pi0
commented
Aug 22, 2022
Thanks for PR. I personally like it if renamed to |
useLayout function to help users to switch layoutuseLayout utilityHomWang
commented
Aug 22, 2022
Currently, it can. Maybe it will have more missions in the future |
There was a problem hiding this comment.
I agree, we don't want to have useLayout(layoutName: string) as the API. (If we used useLayout we would want it to return a ref to the layout, I think.)
setLayout does make sense, and I think preserves the opportunity to add more helpers if needed. We would need to document that this will work on the client, or (if on server) must be used within nuxt route middleware, and, moreover, persisted via a useState so that the client can ensure that the layout it renders is the same.
Possibly we could also implement this workflow - when !nuxtApp.isHydrating? - within this PR.
See https://github.com/nuxt/framework/issues/6824#issuecomment-1222604779.
HomWang
commented
Aug 23, 2022
Yes. Named |
danielroe
commented
Aug 23, 2022
@516310460 FYI, I'll be looking at this shortly to see if it's possible to implement my comment above in this PR. |
HomWang
commented
Aug 23, 2022
Yes, I updated the source code to automatically trigger this PR |
danielroe
commented
Aug 23, 2022
Is there a reason you closed this? |
I need to submit first :) This PR, after waiting for development and testing to complete, I'm reopening |
danielroe
commented
Aug 23, 2022
Oh, I see. You can also use multiple branches in your fork for different PRs. (Might be easier.) |
HomWang
commented
Aug 23, 2022
Thanks, I've never done this before, I'll try this in the future |
useLayout utilitysetLayout utilityHomWang
commented
Aug 25, 2022
@danielroe Thanks you. source context |
danielroe
commented
Aug 26, 2022
My to-do list before merging:
|
pi0
commented
Aug 26, 2022
Makes sense to call it @516310460 Since this PR is made from your @danielroe Do you mind if I move forward with branch creation to merge and letting you opening new PR from branch once could? |
pi0
commented
Aug 26, 2022
@516310460 Also do you have a discord account? I would like to talk with you with daniel and helping on contribution process together. |
HomWang
commented
Aug 26, 2022
I have an account number |
pi0
commented
Aug 26, 2022
Perfect. Mind to send a DM to me? pi0#6582 |
danielroe
commented
Aug 26, 2022
@pi0 Thanks, yes please! |
Good Please wait a moment. I was having dinner |
HomWang
commented
Aug 26, 2022
@pi0 I have already DM you |
pi0
commented
Aug 26, 2022
Co-authored-by: HomWang <516310460@qq.com>
🔗 Linked issue
❓ Type of change
📚 Description
📝 Checklist