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)文章
Vue.js中computed屬性高效的數(shù)據(jù)處理案例
computed是Vue中一個(gè)計(jì)算屬性,它可以根據(jù)依賴的數(shù)據(jù)動(dòng)態(tài)計(jì)算出一個(gè)新的值,并將其緩存起來,這篇文章主要給大家介紹了關(guān)于Vue.js中computed屬性高效的數(shù)據(jù)處理的相關(guān)資料,需要的朋友可以參考下2024-09-09
Vue2.0利用vue-resource上傳文件到七牛的實(shí)例代碼
本篇文章主要介紹了Vue2.0利用vue-resource上傳文件到七牛的實(shí)例代碼,具有一定的參考價(jià)值,有興趣的可以了解一下2017-07-07
用vue和node寫的簡(jiǎn)易購(gòu)物車實(shí)現(xiàn)
這篇文章主要介紹了用vue和node寫的簡(jiǎn)易購(gòu)物車實(shí)現(xiàn),小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-04-04
vue實(shí)現(xiàn)nav導(dǎo)航欄的方法
這篇文章主要為大家詳細(xì)介紹了vue項(xiàng)目nav導(dǎo)航欄的實(shí)現(xiàn)方法,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-12-12
elementui源碼學(xué)習(xí)仿寫el-link示例詳解
這篇文章主要為大家介紹了elementui源碼學(xué)習(xí)仿寫el-link示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-12-12
Vue 自適應(yīng)高度表格的實(shí)現(xiàn)方法
這篇文章主要介紹了Vue 自適應(yīng)高度表格的實(shí)現(xiàn)方法,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-05-05
如何寫好一個(gè)vue組件,老夫的一年經(jīng)驗(yàn)全在這了(推薦)
這篇文章主要介紹了如何寫好一個(gè)vue組件,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-05-05

