專案使用Heroku的mysql作為db,上傳步驟如下:
建立app : heroku create <project_name>
建立 dynos,啟動 Heroku: heroku ps:scale web=1
建立 ClearDB 資料庫: heroku addons:create cleardb:ignite
修改本地 config.json:
"production": { "use_env_variable": "CLEARDB_DATABASE_URL" }
port 記得也要更改:const port = process.env.PORT || 3000
更新 Git 最新進度:
git add .
git commit -m "update config.json"
git push heroku master
heroku run npx sequelize db:migrate
heroku run npx sequelize db:seed:all
若要刪除並重新初始化:
heroku run npx sequelize db:migrate:undo:all
heroku run npx sequelize db:seed:all:undo:all
heroku logs --tail
heroku open
一開始是跟著VueMastery一個教學做的project,上完後覺得裡面用的HTML內建drag and drop API太複雜,不好用且難維護,就試著抽換成vuedraggable,順便學了Tailwind.css,意外發現還蠻好用的。 另外也整理vue-fontawesome的使用方法。 github link 在Vue專案中使用vuedraggable Doc: vuedraggable vuedraggable 是一款以Sortable.js為基礎建立的Vue套件,輕鬆讓你實現拖拉功能並同步變動data,可以到他的playground去玩看看 install
May 25, 2021使用套件 NProgress npm install nprogress include css 在main.js放NProgress的css檔 /main.js import 'nprogress/nprogress.css' 有三種方法使用NProgress.js
Apr 6, 2021先說結論:無法同時使用ESlint和Prettier,ESlint是調整coding的style,Prettier是用來規範coding的嚴謹度,兩者做的事會有衝突。 問題:同時使用ESlint和Prettier,會出現格式衝突 在Vue專案中,想使用vue/max-attributes-per-line,但會和Pretter衝突,造成每次存擋時,都無法如預期效果。 expected when formatOnSave: <template> <div v-show="test" v-if="on"
Oct 8, 2020Goals of writing tests 撰寫測試的目的是什麼?大致可歸類以下三點 Boosted Confidence: 在一個你沒碰過的專案中,有一個測試包就像有一個前輩在隨時檢查你的code,確保你不會一新增功能就破壞程式碼。 Quality Code: 當你在撰寫component testing卻發現困難重重, 那可能表示你的compoent code寫得有問題,需要重構了。 因此,撰寫測試也可以確保你的code有一定的quality。
Sep 8, 2020or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up