vue相關插件總結

一些常用但不被熟知的vue相關生態及插件

本人在項目開發及個人練習中,用到的一些好的插件或工具庫。話不多說,直接安排(官方有文檔的直接附上url)

①vxe-table :一個基於 vue 的 PC 端表格組件,支持增刪改查、虛擬滾動、懶加載、快捷菜單、數據校驗、樹形結構、打印導出、表單渲染、數據分頁、虛擬列表、模態窗口、自定義模板、渲染器、賊靈活的配置項、擴展接口等。

地址:https://xuliangzhan_admin.gitee.io/vxe-table/#/table/start/install

②Clipboard:打印文本插件

地址:http://www.clipboardjs.cn/

③做大數據展示

地址: http://datav.jiaminghi.com/

④vue3.0中文文檔

地址:https://www.vue3js.cn/docs/zh/api/application-api.html

⑤Vuepress:Vue 驅動的靜態網站生成器(個人也是仿照vuepress做的博客)

地址:https://www.vuepress.cn/

⑥vue qs:用於數據序列化或解析字符串

npm install  qs  //安裝
import qs from 'qs'// 在main.js引入
Vue.prototype.$qs = qs//全局配置(如果全局配置必須在main.js裏面寫)

qrcodejs2:根據地址生成二維碼

methods:{
	qrcode() {
	//qrCode有兩個參數,第一個參數是綁定dom元素,這裏根據refs取的,取id話:('#img',{}),第二個參數是一個對象
      let qrcode = new QRCode(this.$refs.img, {
        width: 200, // 設置寬度,單位像素
        height: 200, // 設置高度,單位像素
        text: "https://www.vuepress.cn/", // 設置二維碼內容或跳轉地址
      });
    },
}

⑧lodash:Lodash 是一個一致性、模塊化、高性能的 JavaScript 實用工具庫。(官方原話)

npm i --save lodash  //安裝
//哪個頁面需要使用就取哪個頁面引入,下面以節流爲例
import throttle from "lodash.throttle"
地址:https://www.lodashjs.com/

⑨vuex**-**persistedstate:vuex持久化插件

npm i -S vuex-persistedstate  //安裝
import createPersistedState from 'vuex-persistedstate'  //在vuex初始化的時候,作爲組件引入
export default new Vuex.Store({
   
   
	//...
 plugins: [
     createPersistedState({
   
   

      })
  ]; //vuex-persistedstate默認使用localStorage來固化數據,如果要用sessionStorage,則createPersistedState({storage: window.sessionStorage})
}

⑩vue-json-excel:導出excel表格數據

import JsonExcel from "vue-json-excel";
Vue.component("downloadExcel", JsonExcel);
<download-excel
    class = "export-excel-wrapper"
    :data = "json_data"
    :fields = "json_fields"
    name = "filename.xls">
    <!-- 上面可以自定義自己的樣式,還可以引用其他組件button -->
    <!-- <el-button type="primary" size="small">導出EXCEL</el-button> -->
</download-excel>
  • json_data:需要導出的數據
  • json_fields:自主選擇要導出的字段,若不指定,默認導出全部數據中心全部字段
屬性名 類型 描述
data Array 需要導出的數據,支持中文
fields Object 定義需要導出數據的字段
name String 導出excel的文件名
type String 導出excel的文件類型(xls,csv),默認是xls

⑪ core-js:針對初始化報錯

core-js/modules/es6.array.fill core-js/modules/es6.array.find core-js/modules/es6.array.find-index core-js/modules/es6.array.from core-js/modules/es6.array.iterator core-js/modules/es6.function.name core-js/modules/es6.map core-js/modules/es6.number.constructor core-js/modules/es6.number.is-integer core-js/modules/es6.number.is-nan core-js/modules/es6.number.parse-int core-js/modules/es6.object.assign core-js/modules/es6.object.freeze core-js/modules/es6.object.keys core-js/modules/es6.object.to-string core-js/modules/es6.promise core-js/modules/es6.regexp.constructor core-js/modules/es6.regexp.flags core-js/modules/es6.regexp.match core-js/modules/es6.regexp.replace core-js/modules/es6.regexp.search core-js/modules/es6.regexp.split core-js/modules/es6.regexp.to-string core-js/modules/es6.set core-js/modules/es6.string.anchor core-js/modules/es6.string.bold core-js/modules/es6.string.ends-with core-js/modules/es6.string.fixed core-js/modules/es6.string.includes core-js/modules/es6.string.iterator core-js/modules/es6.string.link core-js/modules/es6.string.starts-with core-js/modules/es6.symbol core-js/modules/es6.typed.uint8-array core-js/modules/es6.typed.uint8-clamped-array core-js/modules/es7.array.includes core-js/modules/es7.object.get-own-property-descriptors core-js/modules/es7.object.values core-js/modules/es7.promise.finally core-js/modules/web.dom.iterable
npm install core-js@2  //安裝

⑫echarts:一個基於 JavaScript 的開源可視化圖表庫

地址:https://echarts.apache.org/zh/index.html

⑬v-charts:基於 Vue2.0 和 echarts 封裝的 v-charts 圖表組件,只需要統一提供一種對前後端都友好的數據格式設置簡單的配置項,便可輕鬆生成常見的圖表

地址:https://vue-echarts.github.io/guide/data.html

⑭uCharts:高性能跨端圖表

地址:https://www.ucharts.cn/
小夥伴們有其他好用的組件歡迎評論哦~
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章