vue-elementui分页条使用
电脑版发表于:2021/11/26 12:19
code:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
<div id="app">
<div class="block">
<span class="demonstration">页数较少时的效果</span>
<el-pagination layout="prev, pager, next"
:total="100"
@@current-change="handlerPage">
</el-pagination>
</div>
</div>
</body>
</html>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script>
new Vue({
el: '#app',
methods: {
handlerPage: function (val) {
this.$message({
message: '点击分页分' + val,
type: 'success'
});
}
},
data: function () {
return { visible: false }
}
})
</script>