Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuxt note #12

Open
larrykkk opened this issue Oct 14, 2019 · 10 comments
Open

Nuxt note #12

larrykkk opened this issue Oct 14, 2019 · 10 comments

Comments

@larrykkk
Copy link
Owner

larrykkk commented Oct 14, 2019

  1. fontawesome icon 剛開始很大然後才變小的問題 Icons load incorrectly (very large) in server side when using library.add (Nuxt.js) FortAwesome/vue-fontawesome#14
  2. 在 Nuxt 中可以自定義 error page 的 layout
    作法:
  • 在 layouts 中新增一個檔案叫 error.vue
  • 使用 yarn dev 開啟開發模式
  • 打開 .nuxt/components/nuxt-error.vue 複製全部內容
  • 貼到步驟 1 的檔案中

3.nuxt 換頁
https://stackoverflow.com/questions/54531166/vuetify-ssr-pagination

  1. 外部網路開啟
    https://stackoverflow.com/questions/55236594/nuxtjs-expose-localhost-to-external-doesnt-work
    https://zh.nuxtjs.org/faq/host-port/

  2. api 依賴注入 控制反轉
    https://codesandbox.io/s/nuxt-axios-api-rsfuf

  3. Authentication
    // trust
    https://github.com/nuxt/docs/blob/master/zh/examples/auth-external-jwt.md

  4. cookie 增刪查
    https://stackoverflow.com/questions/14573223/set-cookie-and-get-cookie-with-javascript
    刪除的成功方式
    https://stackoverflow.com/questions/5688491/unable-to-delete-cookie-from-javascript

  5. 使用 cookie 當作登入機制的 cors 設定
    https://yu-jack.github.io/2019/06/02/ajax-with-session/

  6. 設定 head
    How to set head from asyncData? nuxt/nuxt#1086
    https://stackoverflow.com/questions/47864147/how-do-i-configure-dynamic-og-tags-in-nuxt-js-vue-js

10.編譯很慢怎辦?
nuxt/nuxt#5131 (comment)
https://imgur.com/xwetpiE

  1. Nuxt Warning
    The command 'nuxt build' finished but did not exit after 5s
    upgrade nuxt.js from v.1.4.5 to v2.4.5 and the setInterval problem nuxt/nuxt#5271
    do not use created()

  2. pm2 start

for development

pm2 start -i 4 npm --name "nuxt" -- run dev

for production

npm run build
pm2 start -i 4 npm --name "nuxt" -- run start

  1. Duplicated Meta tags?
    https://nuxtjs.org/faq/duplicated-meta-tags/
@larrykkk
Copy link
Owner Author

@larrykkk
Copy link
Owner Author

nuxt/nuxt#1789

@larrykkk
Copy link
Owner Author

@larrykkk
Copy link
Owner Author

@larrykkk
Copy link
Owner Author

larrykkk commented Nov 4, 2019

https://blog.lichter.io/
部落格

@larrykkk
Copy link
Owner Author

know issue nuxt/nuxt#4008
asyncData fire twice

@larrykkk
Copy link
Owner Author

我在 nuxt 踩的雷 ----- 登入

@larrykkk
Copy link
Owner Author

npm install -g pm2
pm2 start -i 4 npm --name "xxxx" -- run start
pm2 list
pm2 startup
pm2 save

@larrykkk larrykkk changed the title nuxt note Nuxt note Feb 4, 2020
@larrykkk
Copy link
Owner Author

larrykkk commented Feb 4, 2020

Errors

render function or template not defined in component: anonymous
使用 @nuxt/router 下不可使用 component: () => import('@/pages/frontstage/Home.vue'), 寫法
請看作者給出的答案

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant