Home JS special effects jQuery effects jQuery paging plugin code

jQuery paging plugin code

jQuery paging plugin code

jQuery paging plugin code

js代码

  <script src="js/vue.js"></script>
  <script>
    var newlist = new Vue({
      el: '#app',
      data: {
        current_page: 1, //当前页
        pages: 50, //总页数
        changePage:'',//跳转页
        nowIndex:0
      },
      computed:{
         show:function(){
             return this.pages && this.pages !=1
         },
         pstart: function() {
           return this.current_page == 1;
         },
         pend: function() {
           return this.current_page == this.pages;
         },
         efont: function() {
           if (this.pages <= 7) return false;
           return this.current_page > 5
         },
         ebehind: function() {
           if (this.pages <= 7) return false;
           var nowAy = this.indexs;
           return nowAy[nowAy.length - 1] != this.pages;
         },
         indexs: function() {

           var left = 1,
             right = this.pages,
             ar = [];
           if (this.pages >= 7) {
             if (this.current_page > 5 && this.current_page < this.pages - 4) {
               left = Number(this.current_page) - 3;
               right = Number(this.current_page) + 3;
             } else {
               if (this.current_page <= 5) {
                 left = 1;
                 right = 7;
               } else {
                 right = this.pages;

                 left = this.pages - 6;
               }
             }
           }
           while (left <= right) {
             ar.push(left);
             left++;
           }
           return ar;
         },
       },
      methods: {
        jumpPage: function(id) {
          this.current_page = id;
        },
      },

    })
  </script>
一款带跳转功能的vue.js分页插件代码,功能全齐全的vue分页组件,vue.js使用computed计算属性,数据变动执行对应的函数分页代码。 

Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

How to create paging effect with jquery How to create paging effect with jquery

15 Mar 2018

This time I will show you how to use jquery to create paging effects, and what are the precautions for using jquery to create paging effects. The following is a practical case, let’s take a look.

Vinyl record style audio player jQuery plugin Vinyl record style audio player jQuery plugin

19 Jan 2017

Colorizer is a jQuery plug-in that can create a vinyl record-style audio player. This plug-in uses jQuery to drive audio playback and uses CSS3 to create animation effects for the record player.

What special effects can jQuery achieve? Use of jQuery special effects (code example) What special effects can jQuery achieve? Use of jQuery special effects (code example)

13 Nov 2018

What this article brings to you is to introduce what effects jQuery can achieve? Usage of jQuery effects (code example). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

jQuery+formdata creates upload progress effects (with step code) jQuery+formdata creates upload progress effects (with step code)

26 Apr 2018

This time I will bring you jQuery+formdata to create upload progress effects (with step codes). What are the precautions for jQuery+formdata to create upload progress effects? Here is a practical case, let’s take a look.

jQuery code implements development history timeline special effects_jquery jQuery code implements development history timeline special effects_jquery

16 May 2016

This article mainly introduces the jQuery code implementation development process timeline special effects code, with left and right arrows, digital timeline tab switching special effects, friends in need can refer to it.

jQuery mobile dialing interface special effects code sharing_jquery jQuery mobile dialing interface special effects code sharing_jquery

16 May 2016

This article mainly introduces the special effects of jQuery mobile phone dialing interface. The overall special effects are very realistic and natural. I recommend it to everyone. Friends in need can refer to it.

Pure jquery implements simple paging effect (code example) Pure jquery implements simple paging effect (code example)

20 Oct 2018

How to achieve paging effect with pure jquery? What this article brings to you is pure jquery to achieve simple paging effect (code example). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

jquery implements overlay 3D text effects code sharing_jquery jquery implements overlay 3D text effects code sharing_jquery

16 May 2016

This article mainly introduces jquery to implement overlay 3D text effects. The implementation is very simple.

Example code for jQuery to achieve animation effects_jquery Example code for jQuery to achieve animation effects_jquery

16 May 2016

Example code for jQuery to achieve animation effects. Friends who need it can refer to it.

See all articles See all articles

Hot Tools

jQuery2019 Valentine's Day Confession Fireworks Animation Special Effects

jQuery2019 Valentine's Day Confession Fireworks Animation Special Effects

A very popular jQuery Valentine's Day confession fireworks animation special effect on Douyin, suitable for programmers and technical geeks to express their love to the girl they love. No matter you choose to be willing or not, you have to agree in the end.

layui responsive animated login interface template

layui responsive animated login interface template

layui responsive animated login interface template

520 Valentine's Day confession web animation special effects

520 Valentine's Day confession web animation special effects

jQuery Valentine's Day Confession Animation, 520 Confession Background Animation

Cool system login page

Cool system login page

Cool system login page

HTML5 tape music player-CASSETTE PLAYER

HTML5 tape music player-CASSETTE PLAYER

HTML5 tape music player-CASSETTE PLAYER