日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 前端技术 > vue >内容正文

vue

div+mui+vue.js 制作问卷调查单页 ——题目答案是造的json

發(fā)布時間:2024/1/18 vue 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 div+mui+vue.js 制作问卷调查单页 ——题目答案是造的json 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

div+mui+vue.js 制作問卷調(diào)查單頁 ——題目答案是造的json

先來看一下效果圖:

主要就是用讀取json題目和答案,記錄答案ID。 一次性去讀10道題目,vue.js控制當(dāng)前題目的顯示影藏。上一題 記錄 已選擇,下一題判斷 是否選擇了。最后彈出框 顯示 ,然后按后臺需求提交。

<header class="mui-bar mui-bar-nav"><a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left mui-arrowadd"></a><h1 class="mui-title">問卷調(diào)查</h1></header><div class="mui-content mui-content-bgcolor" id="vmode"><div class="questionnaire2"><div id="questionnaire2-box"><div class="questionitem" v-for="(item,index) in questionitems" :data-index="index" @click="oprev(index)"><div class="questionbox" v-show="active === index"><div class="questionnaire2-tit"><p>{{index+1}}/10</p><p>{{item.question_title}}</p></div><div class="questionnaire2-con"><dl class="mui-input-group"><dd class="mui-input-row mui-radio mui-left" v-for="(items,i) in item.question_answerlist" :key='i'><input type="radio" name="radio2" :value="items.answer_id" v-model="answer"/><label class="advice">{{items.answer_option}}</label></dd></dl></div></div></div></div></div><div class="questionnaire2-fot"><a @click="olast">上一題</a><a @click="oNext" v-if='showNext'>下一題</a><input type="button" id="questionbtn" v-else @click ='subquestion' value="提交"/></div>

css:

/*toast信息提示*/ .mui-toast-container {bottom: 50% !important;}/* 問卷調(diào)查2 */ .questionnaire2{margin:40px 20px 0 ;background-color: #fff;}.questionnaire2-tit{background-color: #06b5ff;border-top-left-radius: 10px;border-top-right-radius: 10px;padding:10px 0;} .questionnaire2-tit p{ color: #fff;font-size: 18px;text-align: center;margin-bottom: 0;padding:0 10px;} .questionnaire2-tit p:nth-of-type(2){text-align: left;padding-top:10px;min-height:33px;max-height:73px;overflow: hidden;}.questionnaire2-con{padding:0 10px;background-color: #fff;} .questionnaire2-con dl{margin:0;} .questionnaire2-con dl dd{margin:0;height:auto!important;} .questionnaire2-con dl dd:last-child{border-bottom: 0;}.questionnaire2-fot{margin-left: 20px;margin-right: 20px; border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;overflow: hidden;background-color: #fff;box-sizing: border-box;border-top:1px solid #f4f4f4;} .questionnaire2-fot a{display: inline-block;float: left; width:50%;padding:15px 0;text-align: center; color: #999;} .questionnaire2-fot a:first-child{border-right:1px solid #f4f4f4;} .questionnaire2-fot #next.w{width:100%;}.questionnaire2-fot #questionbtn{width:50%;border:none;font-size: 17px;padding:15px 0; color: #007aff; }.mui-popover-question{width:86%!important;top:50%;left:50%;transform: translate(-50%,-50%)!important;padding:20px;height:260px;} .mui-popover-question.minheight{height:200px;} .mui-popover-question.minheight2{height:180px;} .mui-popover-question h1{font-size:16px; text-align: center;color: #333;font-weight: normal;line-height: 24px;padding-bottom: 10px;margin:0;} .mui-popover-question h1 img{width:20px;height: 20px;margin-left: 10px;margin-top:1px;} .mui-popover-question h2{font-size:14px;color: #999;padding:5px 0;font-weight: normal;text-align: center;} .mui-popover-question p{font-size:14px;color: #999;text-align: center;} .mui-popover-question p.martop2{padding:15px 0;} .mui-popover-question p.martop span{color: #007aff;font-size:18px;padding:0 3px;} .mui-popover-question .closebox{display: block; width:90px;border:none;border-radius: 5px;color: #fff;background-color: #f68644;margin-left:auto;margin-right:auto;} .mui-popover-question .review{font-size: 12px; display: block;text-align: center;padding-top: 10px;color:#999;}

不想復(fù)制的朋友,可以到這里下載個demo看看

總結(jié)

以上是生活随笔為你收集整理的div+mui+vue.js 制作问卷调查单页 ——题目答案是造的json的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。