<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## Loading 加載 全局創建一個顯示頁面加載、異步請求、文件上傳等的加載動效 Loading 只會在全局創建一個,因此在任何位置調用的方法都會控制這同一個組件。主要使用場景是路由切換和Ajax,因為這兩者都不能拿到精確的進度,Loading 會模擬進度,也可以通過`update()`方法來傳入一個精確的進度,比如在文件上傳時會很有用,具體見API。 ![](https://img.kancloud.cn/38/ff/38ff2a2702a2c4837e40be6ad7461575_1908x454.png) ### 代碼示例 `main.js`中引入cview后執行全局配置自定義風格及樣式,具體見API: ```javascript import CviewUi from '@/cview' Vue.use(CviewUi) // 全局配置 Vue.prototype.$cvuLoading.config({ theme: 'default', background: '#266593', color: '#fff', zIndex: 99999, content: '加載中,請耐心等待' }) ``` 在路由中使用 ```javascript router.beforeEach((to, from, next) => { Vue.prototype.$cvuLoading.start() next(); }); router.afterEach(route => { Vue.prototype.$cvuLoading.finish() }); ``` 在異步請求中使用 ```html <script> // 以jQuery的Ajax為例,部分代碼省略 import $ from 'jquery'; export default { methods: { getData () { this.$cvuLoading.start() $.ajax({ url: '/api/someurl', type: 'get', success: () => { this.$cvuLoading.finish() } error: () => { this.$cvuLoading.finish() // theme為progress時可調用error方法 // this.$cvuLoading.error() } }); } } } </script> ``` #### 主題 默認風格`theme`:`"default"`: ![](https://img.kancloud.cn/38/ff/38ff2a2702a2c4837e40be6ad7461575_1908x454.png) 進度條風格`theme`:`"progress"`: ![](https://img.kancloud.cn/0e/2d/0e2dc6189c906e8f4ae137ecbe70ae85_1910x374.png) 頂部百分比風格`theme`:`"percent"`: ![](https://img.kancloud.cn/9c/50/9c50e252439161ff3174459237e3b1be_1920x148.png) 方塊旋轉風格`theme`:`box`: ![](https://img.kancloud.cn/17/57/1757cce87b2a9ab4c7d71cfacab891c4_1890x331.png) icon圖標風格`theme`:`icon`: ![](https://img.kancloud.cn/9e/e1/9ee113c864bb3df63f0626fba0c834ef_1906x295.png) ### API 通過直接調用以下方法來使用組件: * `this.$cvuLoading.start()` * `this.$cvuLoading.finish()` * `this.$cvuLoading.error()` * `this.$cvuLoading.update(percent)` * `this.$cvuLoading.config(options)` * `this.$cvuLoading.destroy()` 以上方法隱式的創建及維護Vue組件。函數及參數說明如下: >[warning] 若`theme`參數為`default`、`box`、`icon`,只調用`start`、`finish`方法控制加載開啟關閉即可,其他方法適用于`theme`參數為`progress`、`percent`等進度條風格。 | 函數名 | 說明 | 參數 | | --- | --- | --- | | start | 開始加載 \/ 開始從 0 顯示進度條,并自動加載進度 | 無 | | finish | 結束加載 \/ 結束進度條,自動補全剩余進度 | 無 | | error | 以錯誤的類型結束進度條,自動補全剩余進度 | 無 | | update | 精確加載到指定的進度 | percent,指定的進度百分比 | | config | 全局配置 | options | | destroy | 全局銷毀 | 無 | ### 局部加載調用 當區塊正在獲取數據中時可使用。 `theme`屬性為`default`、`box`、`icon`時適用。 ![](https://img.kancloud.cn/e8/51/e8513cec0378e3daaca65cfdc8baf7fd_1908x494.png) ```html <cvu-loading theme="box" content="加載中"></cvu-loading> ``` ### props | 屬性 | 說明 | 類型 | 默認值 | | --- | --- | --- | --- | | theme | 主題,可選值default默認風格、box方塊旋轉風格、icon圖標風格、progress進度條風格、percent頂部百分比風格 | String | default | | icon | icon圖標type值,theme屬性為icon時生效 | String | ios-loading | | height | 進度條高度,單位px,theme為progress或percent生效 | Number | \- | | background | 加載頁背景色,theme為default、progress、box或icon生效 | String | \- | | color | 加載頁文字顏色,theme為default、progress、box或icon生效 | String | \- | | progressColor | 進度條顏色,theme為progress生效 | String | \- | | disProgressText | 是否隱藏進度條上方進度值文字,theme為progress生效 | Boolean | false | | percentColor | 頂部百分比進度條顏色,theme為percent生效 | String | \- | | errorColor | 進度條失敗顏色,theme為progress或percent生效 | String | #FF0000 | | zIndex | 進度條顯示層級 | Number | \- | | content | 提示文字,theme為default、progress、box或icon生效 | String | 加載中,請耐心等待 | | duration | 隱藏時的持續時間,單位 ms | Number | 800 |
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看