<em id="09ttv"></em>
    <sup id="09ttv"><pre id="09ttv"></pre></sup>
    <dd id="09ttv"></dd>

        • Vue 組件封裝之 Result 結(jié)果頁

          2020-10-21    前端達人

          一、Result 結(jié)果頁

          組件說明:

          實現(xiàn) Result 結(jié)果頁。

          效果展示:
          在這里插入圖片描述

          實現(xiàn)的功能:

          1. 提交或者操作完成之后,進入一個成功或者失敗的結(jié)果頁。
          2. 包含成功或者失敗的狀態(tài)插圖。
          3. 包含成功或者失敗的文案表述(標題及詳情)。
          4. 包含取消(推出應(yīng)用)和確定(繼續(xù)填寫)兩個按鈕。

          二、使用案例

          <template> <div> <el-result :item="item" @on-cancel="cancel" @on-submit="submit" /> </div> </template> <script> export default { name: "Result", data(){ return{ item: { title: '提交成功', submitText:"繼續(xù)填寫", cancelText:"退出應(yīng)用", status:"success" }, } }, created(){ let item = this.$route && this.$route.query; if(item.status==='fail'){ this.item = { title: '提交失敗,請聯(lián)系開發(fā)人員', submitText:"重新填寫", cancelText:"退出應(yīng)用", status:"fail" } } }, methods:{ cancel(){ dd.biz.navigation.close({ onSuccess : function(result) { /*result結(jié)構(gòu)
                       {}
                       */ }, onFail : function(err) {} }) }, submit(){ this.$router.go(-1) } } } </script>  
          
          • 1
          • 2
          • 3
          • 4
          • 5
          • 6
          • 7
          • 8
          • 9
          • 10
          • 11
          • 12
          • 13
          • 14
          • 15
          • 16
          • 17
          • 18
          • 19
          • 20
          • 21
          • 22
          • 23
          • 24
          • 43
          • 44
          • 45
          • 46
          • 47
          • 48
          • 49
          • 50

          三、API 使用指南

          屬性 說明 類型 默認值
          item 頁面展示的靜態(tài)內(nèi)容集合 Array []
          title 描述標題 String
          submitText 提交按鈕文本 String
          cancelText 取消按鈕文本 String
          status 輸入值字段 String
          on-cancel 取消按鈕事件 Function
          on-submit 提交按鈕事件 Function

          四、源代碼

          Result.vue
          文件路徑:share/result/Result.vue

          <template> <div class="cm-tx-c cm-mt-08 cm-p-02"> <el-image :src="item.status==='success'?successBg:failBg" style="width: 250px" > <div slot="placeholder" class="image-slot"> 圖片加載中<span class="dot">...</span> </div> </el-image> <div :class="item.status==='success'?'success-title':'fail-title'">{{item.title}}</div> <div>{{item.describe}}</div> <div class="cm-flex cm-jc-sa"> <div  @click="cancel()" class="cm-btn-cancel">{{item.cancelText}}</div> <div  @click="submit()" class="cm-btn-submit">{{item.submitText}}</div> </div> </div> </template> <script> import successBg from '../images/result-success.png'; import failBg from '../images/result-fail.png'; export default { name: "ElResult", data(){ return{ successBg, failBg } }, props:{ item:{ type:Object, default:{} } }, created(){ }, methods:{ cancel(){ this.$emit('on-cancel',''); }, submit(){ this.$emit('on-submit',''); } } } </script> <style scoped> .success-title{ padding: 0.4rem; font-size: 0.35rem; color:#15bc83; } .fail-title{ padding: 0.4rem; font-size: 0.35rem; color:#f25643; } </style> 6
          
          
          
          
          
          
          
          
          轉(zhuǎn)載 作者: 2020-10-19 09:24:19 分類專欄: # Vue通用組件封裝
          
          

          日歷

          鏈接

          個人資料

          藍藍設(shè)計的小編 http://www.sdgs6788.com

          存檔

          精品综合久久久久久97| 欧美性猛交xxxx免费看久久久 | 亚洲国产综合久久天堂| 久久综合九色综合欧美就去吻| 久久精品国产亚洲77777| 久久国产高潮流白浆免费观看| 国产精品久久久久国产A级| Xx性欧美肥妇精品久久久久久| 久久久久人妻精品一区三寸蜜桃 | 色播久久人人爽人人爽人人片aV| 欧美性大战久久久久久| 日产精品久久久一区二区| 伊人久久久AV老熟妇色| 久久99国产精品99久久| 中文字幕精品久久| 久久精品免费观看| 久久伊人中文无码| 91久久成人免费| 欧美国产成人久久精品| 国产偷久久久精品专区 | 国产激情久久久久影院小草| 亚洲国产高清精品线久久| 国产精品无码久久久久久| 久久精品国产亚洲网站| 国内精品九九久久精品| 久久亚洲高清综合| 久久99国产精品二区不卡| 久久久久国产日韩精品网站| 精品久久久久久国产| 久久精品国产91久久综合麻豆自制 | 伊人久久大香线蕉综合网站| 久久99国产精品99久久| 久久99精品国产自在现线小黄鸭 | 久久久网中文字幕| 99久久人妻无码精品系列| 国内精品久久久久影院一蜜桃| 亚洲国产精品无码久久SM| 久久人人爽人人爽人人片av麻烦| 国产精品无码久久久久| 国产精品99精品久久免费| 久久ZYZ资源站无码中文动漫 |