This commit is contained in:
qiaopengfei 2024-07-04 19:35:56 +08:00
parent 2012c02efe
commit 4d87e4d80c
4 changed files with 51 additions and 9 deletions

View File

@ -2,7 +2,7 @@ import Vue from 'vue'
import App from '../src/App.vue' import App from '../src/App.vue'
//基于element组件封装引入element组件库 //基于element组件封装引入element组件库
import { Input, Select, Option, OptionGroup, DatePicker ,Tabs,TabPane} from 'element-ui'; import { Input, Select, Option, OptionGroup, DatePicker, Tabs, TabPane, Pagination } from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
Vue.use(Input); Vue.use(Input);
Vue.use(Select); Vue.use(Select);
@ -11,6 +11,7 @@ Vue.use(Option);
Vue.use(DatePicker); Vue.use(DatePicker);
Vue.use(Tabs); Vue.use(Tabs);
Vue.use(TabPane); Vue.use(TabPane);
Vue.use(Pagination)
// 导入组件库 // 导入组件库
import erp_element_ui from '../packages' import erp_element_ui from '../packages'

View File

@ -0,0 +1,9 @@
import agPagination from './src'
// 为组件提供 install 安装方法,供按需引入
agPagination.install = function (Vue) {
Vue.component(agPagination.name, agPagination)
}
// 导出组件
export default agPagination

View File

@ -0,0 +1,36 @@
<template>
<el-pagination class="ag-pagination" v-bind="attrs" v-on="$listeners">
</el-pagination>
</template>
<script>
export default {
name: "agPagination",
props: {
tabsData: {
type: Array,
default: () => {
return [];
},
},
},
data() {
return {};
},
computed: {
attrs() {
return {
total: 0,
"page-size": 20,
"current-page": 1,
"page-sizes": [20, 50, 100, 200],
layout: "total, sizes, prev, pager, next, jumper",
...this.$attrs,
};
},
},
methods: {},
};
</script>
<style scoped lang="scss">
</style>

View File

@ -1,17 +1,11 @@
<template> <template>
<div> <div>
<agTabs <agTabs ref="ref_Pedestal"> </agTabs>
ref="ref_Pedestal"
v-model="value"
:before-leave="handleClick"
:tabsData="tabsData"
>
</agTabs>
</div> </div>
</template> </template>
<script> <script>
import agTabs from "../packages/agTabs/src/index.vue"; import agTabs from "../packages/agPagination/src/index.vue";
export default { export default {
components: { agTabs }, components: { agTabs },
data() { data() {
@ -150,6 +144,8 @@ export default {
handleClick() { handleClick() {
console.log(1111); console.log(1111);
}, },
handleSizeChange() {},
handleCurrentChange() {},
}, },
}; };
</script> </script>