1.0.1 • Published 2 years ago

code-ni-pageui v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

下载👇

cnpm i code-ni-pageui -S

使用

在src/main.js
import  qfui from './qfui'
Vue.use(qfui)

分页

 <div class="page">
     
        <i>&lt;</i>
        <span v-for="(item,index) in total" 
        :key="index" 
        :class="{activeColor:colorIndex===index}"
         @click="changePageFn(item,index)">
            {{item}}
        </span>

        <i>&gt;</i>
</div>
<script>
export default {
    data() {
        return {colorIndex:-1}
    },
    name: 'qfui-page',
    props: {
        total: {  type: Number}
           },
    methods: {
        changePageFn(item,index) {
            this.colorIndex=index
            this.$emit('changePageFn', item)
        }
    }
}
</script>