vue easytable組件使用詳解
Vue Easytable是一個(gè)基于Vue.js的數(shù)據(jù)表格組件庫(kù)。它提供豐富的功能和靈活的配置,幫助開發(fā)者快速搭建復(fù)雜的數(shù)據(jù)表格界面。
中文官網(wǎng)
https://happy-coding-clans.github.io/vue-easytable/#/zh/doc/intro
1.安裝
npm install vue-easytable
2.完整引入
在 main.js 中寫入以下內(nèi)容:
import Vue from "vue"; // 引入樣式 import "vue-easytable/libs/theme-default/index.css"; // 引入組件庫(kù) import VueEasytable from "vue-easytable"; Vue.use(VueEasytable); new Vue({ el: "#app", render: (h) => h(App), });
按需引入
import Vue from "vue"; // 引入樣式 import "vue-easytable/libs/theme-default/index.css"; // 引入組件庫(kù) import { VeTable, VePagination, VeIcon, VeLoading, VeLocale } from "vue-easytable"; Vue.use(VeTable); Vue.use(VePagination); Vue.use(VeIcon); Vue.use(VeLoading); Vue.prototype.$veLoading = VeLoading; Vue.prototype.$veLocale = VeLocale; new Vue({ el: "#app", render: (h) => h(App), });
CDN 方式使用
<!-- 引入樣式 --> <link rel="stylesheet" rel="external nofollow" > <!-- 引入Vue --> <script src="https://cdn.jsdelivr.net/npm/vue@2"></script> <!-- 引入組件庫(kù) --> <script src="https://unpkg.com/vue-easytable/libs/umd/index.js"></script>
示例
<template> <ve-table :columns="columns" :table-data="tableData" /> </template> <script> export default { data() { return { columns: [ { field: "name", key: "a", title: "Name", align: "center" }, { field: "date", key: "b", title: "Date", align: "left" }, { field: "hobby", key: "c", title: "Hobby", align: "right", }, { field: "address", key: "d", title: "Address", }, ], tableData: [ { name: "John", date: "1900-05-20", hobby: "coding and coding repeat", address: "No.1 Century Avenue, Shanghai", }, { name: "Dickerson", date: "1910-06-20", hobby: "coding and coding repeat", address: "No.1 Century Avenue, Beijing", }, { name: "Larsen", date: "2000-07-20", hobby: "coding and coding repeat", address: "No.1 Century Avenue, Chongqing", }, { name: "Geneva", date: "2010-08-20", hobby: "coding and coding repeat", address: "No.1 Century Avenue, Xiamen", }, { name: "Jami", date: "2020-09-20", hobby: "coding and coding repeat", address: "No.1 Century Avenue, Shenzhen", }, ], }; }, }; </script>
到此這篇關(guān)于vue easytable組件的文章就介紹到這了,更多相關(guān)vue easytable組件內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Vue3.0導(dǎo)出數(shù)據(jù)為自定義樣式Excel的詳細(xì)實(shí)例
在許多的后臺(tái)系統(tǒng)中少不了導(dǎo)出Excel表格的功能,下面這篇文章主要給大家介紹了關(guān)于Vue3.0導(dǎo)出數(shù)據(jù)為自定義樣式Excel的相關(guān)資料,文中通過(guò)實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2023-06-06Vue3中從一個(gè)頁(yè)面(index)傳輸數(shù)值到另一個(gè)頁(yè)面(form)的方法詳解
在 Vue 3 開發(fā)中,經(jīng)常需要在不同組件或頁(yè)面之間傳遞數(shù)據(jù),例如從 index 頁(yè)面獲取某個(gè)數(shù)值(如 cntr、tradeId)后,將其傳輸?shù)?nbsp;form 頁(yè)面進(jìn)行填寫或編輯,本文將介紹幾種常見(jiàn)的數(shù)據(jù)傳輸方法,并為每種方法提供一個(gè)小的 Demo 代碼示例,需要的朋友可以參考下2025-02-02多個(gè)vue項(xiàng)目復(fù)用一個(gè)node_modules的問(wèn)題
這篇文章主要介紹了多個(gè)vue項(xiàng)目復(fù)用一個(gè)node_modules的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-09-09vue 動(dòng)態(tài)修改a標(biāo)簽的樣式的方法
這篇文章主要介紹了vue 動(dòng)態(tài)修改a標(biāo)簽的樣式的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-01-01Vue 電商后臺(tái)管理項(xiàng)目階段性總結(jié)(推薦)
這篇文章主要介紹了Vue 電商后臺(tái)管理項(xiàng)目階段性總結(jié),本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-08-08Vue狀態(tài)機(jī)的開啟與停止操作詳細(xì)講解
Vuex是專門為Vuejs應(yīng)用程序設(shè)計(jì)的狀態(tài)管理工具,這篇文章主要給大家介紹了關(guān)于Vuex狀態(tài)機(jī)快速了解與實(shí)例應(yīng)用的相關(guān)資料,需要的朋友可以參考下2023-01-01vue mvvm數(shù)據(jù)響應(yīng)實(shí)現(xiàn)
這篇文章主要介紹了vue mvvm數(shù)據(jù)響應(yīng)實(shí)現(xiàn)的方法,幫助大家更好的理解和使用vue,感興趣的朋友可以了解下2020-11-11