在vue裏面使用iVew框架
iVew框架的文檔 https://www.iviewui.com/docs/guide/install
這裏使用的是 npm 來安裝,在項目下執行下面命令npm install iview --save:
$ npm install iview --save
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ [email protected]
added 10 packages from 12 contributors and audited 32865 packages in 17.509s
found 7 vulnerabilities (1 low, 1 moderate, 4 high, 1 critical)
run `npm audit fix` to fix them, or `npm audit` for details
在main.js 裏面引入:
import iView from ‘iview‘; import ‘iview/dist/styles/iview.css‘; Vue.use(iView);
然後在頁面中使用:
運行就可以看到實現的效果 :)
上面是全部引入該組件庫,如果僅使用裏面的部分組件,也可以選擇按需引入
在vue裏面使用iVew框架