<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://m.sdgs6788.com

          存檔

          精品人妻伦九区久久AAA片69| 99久久中文字幕| 日韩人妻无码一区二区三区久久99 | 粉嫩小泬无遮挡久久久久久| 久久久久国产一级毛片高清版| 99热成人精品免费久久| 中文字幕久久精品| 99久久精品毛片免费播放| 91精品国产91久久久久久蜜臀| 久久这里的只有是精品23| 久久国产精品久久国产精品| 久久免费99精品国产自在现线| 国产A级毛片久久久精品毛片| 久久99精品国产| 中文无码久久精品| 日本久久中文字幕| 久久久久亚洲AV无码永不| 久久久久久久久66精品片| 亚洲国产精品婷婷久久| 香蕉久久av一区二区三区| 丁香五月综合久久激情| 久久久久久久亚洲Av无码| 久久久久亚洲av成人网人人软件| 精品久久久久久国产免费了| 久久精品中文闷骚内射| 色综合久久综合中文综合网 | 久久精品三级视频| 日本一区精品久久久久影院| 久久久亚洲欧洲日产国码二区| 蜜桃麻豆WWW久久囤产精品| 久久久无码精品午夜| 国产精品内射久久久久欢欢| 国产精品久久国产精麻豆99网站 | 青青草国产精品久久久久| 69SEX久久精品国产麻豆| 国产精品一区二区久久不卡| 77777亚洲午夜久久多喷| 久久影院综合精品| 青青草原精品99久久精品66| 久久久精品国产sm调教网站| 久久精品亚洲日本波多野结衣|