0.0.13 • Published 1 year ago
thingstage-vue-components v0.0.13
Vue3 + Vite + Tailwindcss 元件庫
安裝
pnpm add thingstage-vue-components
引入元件庫樣式表
/* main.css of project */
@import "thingstage-vue-components/component.css";
開發
在本地建制模組
pnpm build && pnpm pack
引入開發中的專案,有兩種方法
npm link
在本專案根目錄輸入
npm link
,接著到要引入本專案的目錄下輸入npm link thingstage-vue-components
後會直接將目錄連結建入目標專案的node_modules
下,就能在專案中直接使用元件了(不會在 package.json 中建立依賴,元件庫上線後要再記得加入)。這個方法因為是整個專案目錄載入,有可能會出現宣告衝突,如果發生的話就要使用第二個方法。
上面如果有用
pnpm pack
指令的話會在根目錄產生.tgz
檔案,可以在目標目錄直接使用這個檔案pnpm add {relative-path-to-component-repo}/thingstage-vue-components-{repo-version}.tgz
有時候會因爲套件管理工具有暫存,導致沒有更新,要先清掉暫存在安裝,再不行就要 remove 後再加回來。