<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. 包含成功或者失敗的文案表述(標(biāo)題及詳情)。
          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 描述標(biāo)題 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://m.sdgs6788.com

          存檔

          亚洲国产精品无码久久一区二区| yellow中文字幕久久网| 亚洲中文字幕无码久久2017| 久久亚洲国产成人精品性色| 久久综合丁香激情久久| 久久这里的只有是精品23| 久久99精品久久久久子伦| 久久99精品久久久久久噜噜| 97久久国产综合精品女不卡| 国产精品内射久久久久欢欢| 亚洲国产欧美国产综合久久| 国内精品久久久久久久亚洲 | 久久综合国产乱子伦精品免费| 欧美激情精品久久久久| 亚洲va久久久噜噜噜久久男同| 国产成人精品久久综合| 久久99精品久久久久久hb无码| 久久久久亚洲精品男人的天堂| www.久久热| 久久久久久国产精品免费无码| 久久99精品久久久久婷婷| 一本综合久久国产二区| 久久99亚洲综合精品首页| 国产国产成人精品久久| 久久99精品国产自在现线小黄鸭| 最新久久免费视频| 久久婷婷是五月综合色狠狠| 久久久久国产日韩精品网站| 国产午夜精品理论片久久| 久久精品国产99国产精偷| 999久久久无码国产精品| 麻豆成人久久精品二区三区免费| 久久人人爽人人人人爽AV| 久久精品国产亚洲AV香蕉| 久久天天躁狠狠躁夜夜avapp| 亚洲日本va午夜中文字幕久久 | 久久无码人妻一区二区三区 | 久久精品国产99国产精品导航 | 国产99久久久国产精免费| 国产69精品久久久久9999| 久久亚洲精品无码播放|