免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
當vue 頁面加載數(shù)據時顯示 加載loading

Vue 頁面加載數(shù)據之前增加 `loading` 動畫

創(chuàng)建組件

1、新建 .vue 文件: src -> components -> laoding -> index.vue

2、編輯 index.vue 文件

<template>    <div class="loading"></div></template><script>    export default {        name: "loading"    }</script><style scoped>    .loading {        position: fixed;        left: 20%;        top: 20%;        background: url('../../assets/images/load2.gif') center center no-repeat ;        width: 50vw;        height: 50vh;        z-index: 1000;    }</style>

使用組件

通過自定義一個變量 isLoading 初始化為 true ,在數(shù)據請求成功之后將變量改為 false ,在 template 中通過變量來控制是否顯示隱藏,使用 vue 自帶的 增加用戶體驗

需要在全局的 css 中加入過渡需要的樣式 globle.css

.fade-enter,.fade-leave-active {  opacity: 0;}.fade-enter-active,.fade-leave-active {  transition: opacity 0.5s;}

.vue 文件使用代碼示例片段

                <el-table-column prop="salechnl" label="銷售渠道" width="200" align="center"></el-table-column>                <el-table-column prop="riskname" label="險種名稱" width="200" align="center"></el-table-column>            </el-table>            <!-- 分頁 --><!--                        <div align="right" style="margin-top: 20px;margin-right:245px">--><!--                            <el-pagination--><!--                                    background--><!--                                    @size-change="handleSizeChange"--><!--                                    @current-change="handleCurrentChange"--><!--                                    :current-page.sync="currentPage"--><!--                                    :page-sizes="pageCount"--><!--                                    :page-size="5"--><!--                                    layout="sizes, prev, pager, next, jumper,total"--><!--                                    :total="count"--><!--                            ></el-pagination>--><!--                        </div>-->            <transition name="fade">                <loading v-if="isLoading"></loading>            </transition>                </div>    </div></template>

<script>    import http from '../../../assets/js/http'    import Loading from '../../../components/loading/index'    export default {        components:{ Loading  },        data() {            return {                isLoading: false,                dData: [],        methods: {            loadData(){                this.isLoading = true;                var data = {};                //參數(shù)                let userInfo = Lockr.get('userInfo')if (this.formInline.contract_start_date != '' ) {                    data.contract_start_date = this.formatter(this.formInline.contract_start_date, "yyyy-MM-dd")                } else {                    data.contract_start_date = "";                };                if (this.formInline.contract_end_date != '' ) {                    data.contract_end_date = this.formatter(this.formInline.contract_end_date, "yyyy-MM-dd")                } else {                    data.contract_end_date = this.formInline.contract_end_date                };                console.log("%c -------傳遞額參數(shù)-----","color:green");                console.log(data);                this.apiPost('underwritelist/queryunderwritelist', data).then((res) => {                    console.log(res);                    this.tableData=[];                    this.handelResponse(res, (data) => {                        console.log(res);                        this.tableData = data.list;                        this.count = data.total;                        this.isLoading = false;                    })                });            },

本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
Vue3又出新語法 到底何時才能折騰完?
Vue 開發(fā)必須知道的 36 個技巧
Vue-resource
Vue 前端設計模式梳理
vue使用vue-lazyload實現(xiàn)圖片懶加載
英文版外貿合同
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服