• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com专业计算机教程网站
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • html/xhtml
  • html5
  • CSS
  • XML/XSLT
  • Dreamweaver教程
  • Frontpage教程
  • 心得技巧
  • bootstrap
  • vue
  • AngularJS
  • HBuilder教程
  • css3
  • 浏览器兼容
  • div/css
  • 网页编辑器
  • axure
您的位置:首页 > 网页设计 >vue > vue2.0多条件搜索组件使用详解

vue2.0多条件搜索组件使用详解

作者:奈奈幂 字体:[增加 减小] 来源:互联网 时间:2017-05-30

本文主要包含vue2.0分页组件,vue2.0父子组件通信,vue2.0 组件通信,vue2.0 组件,vue2.0 自定义组件等相关知识,奈奈幂 希望在学习及工作中可以帮助到您

本文为大家分享了vue2.0多条件搜索组件的实现方法,供大家参考,具体内容如下

搜索条件为死数据,通过select下拉,选取多个条件;同时可点击加号增加搜索条件,点击减号减少搜索条件;

templete

<template> 
 <div class="retrievalmian"> 
 <div class="retrievaltitle"> 
 <a class="btn-default tabbtn" @click="seniorsearch('')" :class="[tabbtn==''?'checked':'']" >高级搜索</a> 
 <a class="btn-default tabbtn" @click="seniorsearch('author')" :class="[tabbtn=='author'?'checked':'']" >作者搜索</a> 
 </div> 
 <div class="retrievalbar"> 
 <div class="formbody"> 
 <div class="formoperate"> 
  <span class="tipsicon addplus" @click="addplus" v-show="formtips.length<12"></span> 
  <span class="tipsicon removeminus" @click="removeminus" v-show="formtips.length>=4"></span> 
 </div> 
 <div class="formline"> 
  <div class="formtips" v-for="(item,index) in formtips"> 
  <div class="formgroup"> 
  <select class="formcontrol" v-model="item.titletype"> 
  <option v-for="typeselect in titletype" v-if="tabbtn==''" :value="typeselect.value">{{typeselect.text}}</option> 
  <option v-for="typeselect in titletypeAuthor" v-if="tabbtn=='author'&&!(index%2)" :value="typeselect.value">{{typeselect.text}}</option> 
  <option v-for="typeselect in titletypeAuthor2" v-if="tabbtn=='author'&&(index%2)" :value="typeselect.value">{{typeselect.text}}</option> 
  </select> 
  </div> 
  <div class="formgroup"> 
  <input type="text" class="forminp" v-model="item.typeinp"> 
  </div> 
  <div class="formgroup"> 
  <select class="formcontrol" > 
  <option v-for="accuracy in accuracys" :value="accuracy.value">{{accuracy.text}}</option> 
  </select> 
  </div> 
  <div class="formgroup"> 
  <select class="formcontrol" v-model="item.containlist"> 
  <option v-for="containlist in containlists" :value="containlist.value">{{containlist.text}}</option> 
 
  </select> 
  </div> 
  </div> 
 </div> 
 <div class="formline"> 
  <div class="formgroup"> 
  <div class="catalog" @click="catalogshow" >文献分类目录</div> 
  <div class="cataloghint"> 
  <ul class="cataloglist" v-show="iscataloglist"> 
  <li> 
   <div class="checkbox"> 
   <label> 
   <input type="checkbox" v-model="cataloglist" value="核工业">核工业 
   </label> 
   </div> 
  </li> 
  <li> 
   <div class="checkbox"> 
   <label> 
   <input type="checkbox" v-model="cataloglist" value="航天工业">航天工业 
   </label> 
   </div> 
  </li> 
  <li> 
   <div class="checkbox"> 
   <label> 
   <input type="checkbox" v-model="cataloglist" value="航空工业">航空工业 
   </label> 
   </div> 
  </li> 
  <li> 
   <div class="checkbox"> 
   <label> 
   <input type="checkbox" v-model="cataloglist" value="船舶工业">船舶工业 
   </label> 
   </div> 
  </li> 
  <li> 
   <div class="checkbox"> 
   <label> 
   <input type="checkbox" v-model="cataloglist" value="兵器工业">兵器工业 
   </label> 
   </div> 
  </li> 
  <li> 
   <div class="checkbox"> 
   <label> 
   <input type="checkbox" v-model="cataloglist" value="军工电子">军工电子 
   </label> 
   </div> 
  </li> 
  <li> 
   <div class="checkbox"> 
   <label> 
   <input type="checkbox" v-model="cataloglist" value="国防综合">国防综合 
   </label> 
   </div> 
  </li> 
  <li> 
   <div class="checkbox"> 
   <label> 
   <input type="checkbox" v-model="cataloglist" value="其他">其他 
   </label> 
   </div> 
  </li> 
 
  </ul> 
  </div> 
  </div> 
 </div> 
 <div class="formline"> 
  <div class="formgroup"> 
  <select class="formcontrollarg" v-model="timestart"> 
  <option v-for="startlist in timestarts" :value="startlist.value">{{startlist.text}}</option> 
  </select> 
  <span>——</span> 
  <select class="formcontrollarg" v-model="timeend"> 
  <option v-for="endlist in timeends" :value="endlist.value">{{endlist.text}}</option> 
  </select> 
  </div> 
 </div> 
 <div class="formsearch"> 
  <button type="button" class="retrievalsearch btn btn-primary" @click="retrievalsearch">检索</button> 
 </div> 
 </div> 
 </div> 
 </div> 
</template> 
</div>

script

<script> 
 import $ from 'jquery' 
 import conf from './../Conf'; 
 
 export default{ 
 data(){ 
 return { 
 formtips:[ 
 
 ], 
 tabbtn: '',//搜索切换 
 cataloglist:[],//文献分类选中目录 
 iscataloglist:false, 
 
 
 titletype:[ 
  { text: '标题', value: 'title' }, 
  { text: '正文', value: 'text' }, 
  { text: '项目', value: 'project' }, 
  { text: '人员', value: 'person' }, 
  { text: '机构', value: 'organization' }, 
  { text: '技术', value: 'tech' }, 
  { text: '地区', value: 'locaton' }, 
  { text: '国家', value: 'country' } 
 ], 
 titletypeAuthor:[{ text: '作者', value: 'author' }], 
 titletypeAuthor2:[{ text: '作者机构', value: 'authoruint' }], 
 accuracys: [ 
  {text:'精确',value:'accurate'}, 
  {text:'模糊',value:'blur'} 
 ], 
 containlists:[ 
  {text:'并含',value:'andwidth'}, 
  {text:'或含',value:'orwidth'}, 
  {text:'不含',value:'nowidth'}, 
 ], 
 
 timestart:'nolimit',//检索起始时间 
 timeend:'2017',//检索结束时间 
 timestarts:[],//开始时间选择数组 
 timeends:[],//结束时间选择数组 
 } 
 }, 
 watch:{ 
 
 }, 
 created: function () { 
 this.init(); 
 }, 
 methods: { 
 init: function(){ 
 this.formtips=[ 
  { 
  titletype:'title', 
  typeinp:'', 
  accuracy:'accurate', 
  containlist:'andwidth', 
  }, 
  { 
  titletype:'title', 
  typeinp:'', 
  accuracy:'accurate', 
  containlist:'andwidth', 
  }, 
  { 
  titletype:'title', 
  typeinp:'', 
  accuracy:'accurate', 
  containlist:'andwidth', 
  }, 
  { 
  titletype:'title', 
  typeinp:'', 
  accuracy:'accurate', 
  containlist:'andwidth', 
  } 
 ]; 
 this.timestarts = [ 
  {text:'不限',value:'nolimit'}, 
  {text:'2016',value:'2016'}, 
  {text:'2015',value:'2015'}, 
  {text:'2014',value:'2014'}, 
  {text:'2013',value:'2013'}, 
  {text:'2012',value:'2012'}, 
  {text:'2011',value:'2011'}, 
 ]; 
 this.timeends = [ 
  {text:'2017',value:'2017'}, 
  {text:'2016',value:'2016'}, 
  {text:'2015',value:'2015'}, 
  {text:'2014',value:'2014'}, 
  {text:'2013',value:'2013'}, 
  {text:'2012',value:'2012'}, 
  {text:'2011',value:'2011'}, 
 ] 
 }, 
 addplus:function () { 
 if(this.tabbtn==''){ 
  this.formtips.push({ 
  titletype:'title', 
  typeinp:'', 
  accuracy:'accurate', 
  containlist:'andwidth', 
  }); 
  this.formtips.push({ 
  titletype:'title', 
  typeinp:'', 
  accuracy:'accurate', 
  containlist:'andwidth', 
  }); 
 }else{ 
  this.formtips.push({ 
  titletype:'author', 
  typeinp:'', 
  accuracy:'accurate', 
  containlist:'andwidth', 
  }); 
  this.formtips.push({ 
  titletype:'authoruint', 
  typeinp:'', 
  accuracy:'accurate', 
  containlist:'andwidth', 
  }); 
 } 
 
 }, 
 removeminus:function () { 
 this.formtips.splice(-2); 
 }, 
 seniorsearch:function (str) { 
 if(this.tabbtn!=str){ 
  this.tabbtn = str; 
  if(this.tabbtn==''){ 
  this.formtips=[ 
  { 
  titletype:'title', 
  typeinp:'', 
  accurac
  


 

您可能想查找下面的文章:

  • 一个可复用的vue分页组件
  • vue2.0多条件搜索组件使用详解
  • Vue2.0表单校验组件vee-validate的使用详解
  • vue基于Vue2.0和高德地图的地图组件实例
  • vue2.0父子组件间通信的实现方法
  • vue 2.0组件与v-model详解
  • 详解vue2.0组件通信各种情况总结与实例分析
  • 基于Vue2.0的分页组件
  • Vue2.0利用 v-model 实现组件props双向绑定的优美解决方案
  • 基于vue2.0+vuex的日期选择组件功能实现

相关文章

  • 2017-05-30详解Vue.js动态绑定class
  • 2017-05-30详解前后端分离之VueJS前端
  • 2017-08-19Vue 实现登录拦截(二)
  • 2017-05-30Vuex和前端缓存的整合策略详解
  • 2017-05-30浅谈Vue的基本应用
  • 2017-09-05vue有关路由跳转,初始路由设置
  • 2017-05-30Vue键盘事件用法总结
  • 2017-05-30详解Vue2.0之去掉组件click事件的native修饰
  • 2017-05-30Vue.js实战之通过监听滚动事件实现动态锚点
  • 2017-05-30Vue组件开发初探

文章分类

  • html/xhtml
  • html5
  • CSS
  • XML/XSLT
  • Dreamweaver教程
  • Frontpage教程
  • 心得技巧
  • bootstrap
  • vue
  • AngularJS
  • HBuilder教程
  • css3
  • 浏览器兼容
  • div/css
  • 网页编辑器
  • axure

最近更新的内容

    • 详解vue-validator(vue验证器)
    • Vuejs第七篇之Vuejs过渡动画案例全面解析
    • Vue中使用vux的配置详解
    • Vue.js render方法使用详解
    • Vue中img的src属性绑定与static文件夹实例
    • Vue.js tab实现选项卡切换
    • 详解Vue-cli 创建的项目如何跨域请求
    • vue.js学习之递归组件
    • 深入理解vue路由的使用
    • vue组件如何被其他项目引用

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有