全球彩票平台_全球彩票注册平台|官网下载地址

热门关键词: 全球彩票平台,全球彩票注册平台,全球彩官网下载地址

【全球彩官网下载地址】基于vue实现多引擎搜索

基于Vue.js 2.0实现百度搜索框效果,vue.js2.0

使用Vue.js 2.0 模仿百度搜索框效果,供大家参考,具体内容如下

<!DOCTYPE html>
<html>
<head>
 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=2.0, maximum-scale=1.0, minimum-scale=1.0">
 <title>Vue模拟百度搜索</title>
 <style type="text/css">
 body, html{
  padding: 0;
  margin: 0;
 }
 #box{
  margin-top: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
 }
 .input{
  width: 500px;
  height: 30px;
  text-indent: 4px;
 }
 .baidu input{
  height: 30px;
  cursor: pointer;
  color: #fff;
  letter-spacing: 1px;
  background: #3385ff;
  border: 1px solid #2d78f4;
 }
 ul{
  padding: 0;
  margin-top: 6px;
 }
 li{
  list-style: none;
  margin: 4px;
 }
 li:hover{
  background: #ccc;
 }
 .bgcolor {
  background: #ccc;
 }
 </style>
 <script src="http://www.alphahp.com/uploads/allimg/190822/033S61942-0.jpg"></script>
 <script src="http://www.alphahp.com/uploads/allimg/190822/033S623G-1.jpg"></script>
 <script type="text/javascript">
 window.onload = function() {
  new Vue({
   el: '#box',
   data: {
    inputText: '',
    text: '',
    nowIndex: -1,
    result: []
   },
   methods: {
    show (ev) {
     if (ev.keyCode == 38 || ev.keyCode == 40) {
      if (this.nowIndex < -1){
       return;
      }
      if (this.nowIndex != this.result.length && this.nowIndex != -1) {
       this.inputText = this.result[this.nowIndex];
      }
      return;
     }
     if (ev.keyCode == 13) {
      window.open('https://www.baidu.com/s?wd='   this.inputText, '_blank');
      this.inputText = '';
     }
     this.text = this.inputText;
     this.$http.jsonp('https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su', {
      params: {
       wd: this.inputText
      },
      jsonp: 'cb'
     }).then(res => {
      this.result = res.data.s;
     })
    },
    goto () {
     window.open('https://www.baidu.com/s?wd='   this.inputText, '_blank');
     this.inputText = '';
    },
    gotoItem(item) {
     window.open('https://www.baidu.com/s?wd='   item, '_blank');
     this.inputText = '';
    },
    down () {
     this.nowIndex  ;
     if (this.nowIndex == this.result.length) {
      this.nowIndex = -1;
      this.inputText = this.text;
     }
    },
    up () {
     this.nowIndex--;
     if (this.nowIndex < -1){
      this.nowIndex = -1;
      return;
     }
     if (this.nowIndex == -1) {
      this.nowIndex = this.result.length;
      this.inputText = this.text;
     }
    }
   }
  });
 }
 </script>
</head>

<body>
 <div id="box">
 <img src="https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png" width="270" height="129">
  <div>
   <div>
    <input 
     type="text" 
     class="input" 
     placeholder="请输入搜索内容 " 
     v-model='inputText' 
     @keyup='show($event)' 
     @keydown.down='down()' 
     @keydown.up.prevent='up()'
    >

     <input type="submit" value="百度一下" >

   </div>

   <ul>
    <li v-for="(item, index) in result" :class='{bgcolor: index==nowIndex}' @click="gotoItem(item)">
     {{item}}
    </li>
   </ul>
  </div>

 </div>
</body> 
</html>

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持帮客之家。

2.0实现百度搜索框效果,vue.js2.0 使用Vue.js 2.0 模仿百度搜索框效果,供大家参考,具体内容如下 !DOCTYPE htmlhtmlhead meta charset="utf-...

使用Vue.js 2.0 模仿百度搜索框效果,供大家参考,具体内容如下

window.location.href = "" document.getElementById("searchData").value;

Vue.js结合bootstrap实现分页控件,vue.jsbootstrap

本文为大家分享了使用vue.js结合bootstrap 开发的分页控件,供大家参考,具体内容如下

效果如下

全球彩官网下载地址 1

全球彩官网下载地址 2

全球彩官网下载地址 3

实现代码:

<!DOCTYPE html> 
<html> 
<head> 
 <meta charset="utf-8" /> 
 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 
 <title> Vue-PagerTest</title> 
 <link rel="stylesheet" href="/lib/bootstrap/dist/css/bootstrap.css" rel="external nofollow" /> 
</head> 
<body> 
 <div class="container body-content"> 
 <div id="test" class="form-group"> 
  <div class="form-group"> 
  <div class="page-header"> 
   数据 
  </div> 
  <table class="table table-bordered table-responsive table-striped"> 
   <tr> 
   <th>姓名</th> 
   <th>年龄</th> 
   <th>删除信息</th> 
   </tr> 
   <tr v-for="item in arrayData"> 
   <td class="text-center">{{item.name}}</td> 
   <td>{{item.age}}</td> 
   <td><a href="javascript:void(0)" rel="external nofollow" v-on:click="deleteItem($index,item.age)">del</a></td> 
   </tr> 
  </table> 
  <div class="page-header">分页</div> 
  <div class="pager" id="pager"> 

   <select class="form-control" v-model="pagesize" v-on:change="showPage(pageCurrent,$event,true)" number> 
    <option value="10">10</option> 
    <option value="20">20</option> 
    <option value="30">30</option> 
    <option value="40">40</option> 
   </select> 

   <template v-for="item in pageCount 1"> 

    首页 


    上一页 


    {{item}} 


    ... 

   1&&item<=pageCount-1&&item>=showPagesStart&&item<=showPageEnd&&item<=pageCount" class="btn btn-default" v-on:click="showPage(item,$event)"  v-bind:class="item==pageCurrent?'active':''"> 
    {{item}} 

   showPageEnd 1" class="btn btn-default disabled"> 
    ... 

   v-bind:class="item==pageCurrent?'active':''"> 
    {{item}} 


    下一页 


    尾页 

   </template> 

   <input class="pageIndex form-control" style="width:60px;text-align:center" type="text" v-model="pageCurrent | onlyNumeric" v-on:keyup.enter="showPage(pageCurrent,$event,true)" /> 

   {{pageCurrent}}/{{pageCount}} 
  </div> 
  </div> 
 </div> 
 <hr /> 
 <footer> 
  <p>© 2016 - 笑问苍天丶</p> 
 </footer> 
 </div> 


 <script src="/lib/jquery/dist/jquery.js"></script> 
 <script src="/lib/bootstrap/dist/js/bootstrap.js"></script> 
 <script src="/lib/vue.js"></script> 
 <script> 
 //只能输入正整数过滤器 
 Vue.filter('onlyNumeric', { 
  // model -> view 
  // 在更新 `<input>` 元素之前格式化值 
  read: function (val) { 
  return val; 
  }, 
  // view -> model 
  // 在写回数据之前格式化值 
  write: function (val, oldVal) { 
  var number =  val.replace(/[^d]/g, '') 
  return isNaN(number) ? 1 : parseFloat(number.toFixed(2)) 
  } 
 }) 

 //数组删除某项功能 
 Array.prototype.remove = function (dx) { 
  if (isNaN(dx) || dx > this.length) { return false; } 
  for (var i = 0, n = 0; i < this.length; i  ) { 
  if (this[i] != this[dx]) { 
   this[n  ] = this[i] 
  } 
  } 
  this.length -= 1 
 } 

 var vue = new Vue({ 
  el: "#test", 
  data: { 
  //总项目数 
  totalCount: 200, 
  //分页数 
  pageCount: 20, 
  //当前页面 
  pageCurrent: 1, 
  //分页大小 
  pagesize: 10, 
  //显示分页按钮数 
  showPages: 11, 
  //开始显示的分页按钮 
  showPagesStart: 1, 
  //结束显示的分页按钮 
  showPageEnd: 100, 
  //分页数据 
  arrayData: [] 
  }, 
  methods: { 
  //分页方法 
  showPage: function (pageIndex, $event, forceRefresh) { 

   if (pageIndex > 0) { 


   if (pageIndex > this.pageCount) { 
    pageIndex = this.pageCount; 
   } 

   //判断数据是否需要更新 
   var currentPageCount = Math.ceil(this.totalCount / this.pagesize); 
   if (currentPageCount != this.pageCount) { 
    pageIndex = 1; 
    this.pageCount = currentPageCount; 
   } 
   else if (this.pageCurrent == pageIndex && currentPageCount == this.pageCount && typeof (forceRefresh) == "undefined") { 
    console.log("not refresh"); 
    return; 
   } 

   //测试数据 随机生成的 
   var newPageInfo = []; 
   for (var i = 0; i < this.pagesize; i  ) { 
    newPageInfo[newPageInfo.length] = { 
    name: "test"   (i   (pageIndex - 1) * 20), 
    age: (i   (pageIndex - 1) * 20) 
    }; 
   } 
   this.pageCurrent = pageIndex; 
   this.arrayData = newPageInfo; 

   //计算分页按钮数据 
   if (this.pageCount > this.showPages) { 
    if (pageIndex <= (this.showPages - 1) / 2) { 
    this.showPagesStart = 1; 
    this.showPageEnd = this.showPages - 1; 
    console.log("showPage1") 
    } 
    else if (pageIndex >= this.pageCount - (this.showPages - 3) / 2) { 
    this.showPagesStart = this.pageCount - this.showPages   2; 
    this.showPageEnd = this.pageCount; 
    console.log("showPage2") 
    } 
    else { 
    console.log("showPage3") 
    this.showPagesStart = pageIndex - (this.showPages - 3) / 2; 
    this.showPageEnd = pageIndex   (this.showPages - 3) / 2; 
    } 
   } 
   console.log("showPagesStart:"   this.showPagesStart   ",showPageEnd:"   this.showPageEnd   ",pageIndex:"   pageIndex); 
   } 

  } 
  , deleteItem: function (index, age) { 
   if (confirm('确定要删除吗')) { 
   //console.log(index, age); 

   var newArray = []; 
   for (var i = 0; i < this.arrayData.length; i  ) { 
    if (i != index) { 
    newArray[newArray.length] = this.arrayData[i]; 
    } 
   } 
   this.arrayData = newArray; 
   } 
  } 
  } 
 }); 
 vue.$watch("arrayData", function (value) { 
  //console.log("==============arrayData begin=============="); 
  //console.log(value==vue.arrayData); 
  //console.log(vue.arrayData); 
  //console.log("==============arrayData end=============="); 
 }); 
 vue.showPage(vue.pageCurrent, null, true); 
 </script> 
</body> 
</html> 

源码下载: bootstrap分页控件

参考资料: Vue.js官网

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持帮客之家。

本文为大家分享了使用vue.js结合bootstrap 开发的分页控件,供大家参考,具体内容如下 效果如下...

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <script src="../lib/vue.min.js"></script>
  <style>
    *{margin:0;padding:0;}
    #tabPanel .itemname{height:40px;width:180px;margin-bottom:10px;}
    #tabPanel .itemcontent{height:40px;width:180px;}
    #tabPanel .addbtn{width:100px;height:30px;}
    #tabPanel .active{background:#eee;}
    #tabPanel{height:340px;width:500px;margin:100px auto;}
    #tabPanel .tab{height:40px;background:#ccc;margin-top:10px;}
    #tabPanel .tab ul li{list-style: none;float:left;width:80px;height:40px;text-align:center;line-height:40px;}
    #tabPanel .content{height:300px;width:500px;background:#eee;}
  </style>
  <title>Vue.js编写tab滑块效果</title>
</head>
<body>
  <div id="tabPanel">
    <label>添加滑块名称:<input type="text" v-model="tabItem" class="itemname"></label><br>
    <label>添加滑块内容:<input type="text" v-model="tabContent" class="itemcontent"></label><br>
    <input type="button" value="添加选项" @click="addItem()" class="addbtn">
    <div class="tab">
      <ul>
        <li v-for="(value, index) in tabs" v-bind:class="{active: index == num }" @mouseover="toggle(index)" @dblclick="del(index)">{{value}}</li>
      </ul>
    </div>
    <div class="content">
      <div class="box" v-for="(value, index) in tabContents" v-show="index == num" contenteditable="true" @blur="editContent(index,value)">{{value index}}</div>
    </div>
  </div>
</body>
<script>
  var v = new Vue ({
    el: "#tabPanel",
    data: {
      tabs: ["第一项","第二项"],
      tabContents: ["第一项内容","第二项内容"],
      num: 0,
      tabItem:"",
      tabContent:""
    },
    methods:{
      //切换滑块
      toggle: function(index){
        this.num = index;
      },
      //添加滑块
      addItem: function(){
        if(this.tabItem == "" || this.tabContent == ""){
          alert("填写完整的名称和内容");
        }else{
          this.tabs.push(this.tabItem);
          this.tabContents.push(this.tabContent);
        }
      },
      //双击删除滑块
      del: function(index){
        this.tabs.splice(index,1);
        this.tabContents.splice(index,1)
      },
      //编辑选项内容
      editContent: function(index,value){
        this.tabContents[index] = value;
        console.log(this.tabContents);
      }
    }
  });
</script>
</html>

您可能感兴趣的文章:

  • Vue 仿百度搜索功能实现代码
  • 基于Vue.js实现简单搜索框
  • Vue.js实现实例搜索应用功能详细代码
  • 基于vue实现多引擎搜索及关键字提示
  • vue2 前端搜索实现示例
  • 基于Vuejs的搜索匹配功能实现方法

<input id="searchData" type="text" placeholder="搜索一下" name="word" @keyup="listenWords" @input="listenInput" @focus="listenInput" />

全球彩官网下载地址 4

<!DOCTYPE html>
<html>
<head>
 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=2.0, maximum-scale=1.0, minimum-scale=1.0">
 <title>Vue模拟百度搜索</title>
 <style type="text/css">
 body, html{
  padding: 0;
  margin: 0;
 }
 #box{
  margin-top: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
 }
 .input{
  width: 500px;
  height: 30px;
  text-indent: 4px;
 }
 .baidu input{
  height: 30px;
  cursor: pointer;
  color: #fff;
  letter-spacing: 1px;
  background: #3385ff;
  border: 1px solid #2d78f4;
 }
 ul{
  padding: 0;
  margin-top: 6px;
 }
 li{
  list-style: none;
  margin: 4px;
 }
 li:hover{
  background: #ccc;
 }
 .bgcolor {
  background: #ccc;
 }
 </style>
 <script src="http://www.alphahp.com/uploads/allimg/190822/033S61942-0.jpg"></script>
 <script src="http://www.alphahp.com/uploads/allimg/190822/033S623G-1.jpg"></script>
 <script type="text/javascript">
 window.onload = function() {
  new Vue({
   el: '#box',
   data: {
    inputText: '',
    text: '',
    nowIndex: -1,
    result: []
   },
   methods: {
    show (ev) {
     if (ev.keyCode == 38 || ev.keyCode == 40) {
      if (this.nowIndex < -1){
       return;
      }
      if (this.nowIndex != this.result.length && this.nowIndex != -1) {
       this.inputText = this.result[this.nowIndex];
      }
      return;
     }
     if (ev.keyCode == 13) {
      window.open('https://www.baidu.com/s?wd='   this.inputText, '_blank');
      this.inputText = '';
     }
     this.text = this.inputText;
     this.$http.jsonp('https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su', {
      params: {
       wd: this.inputText
      },
      jsonp: 'cb'
     }).then(res => {
      this.result = res.data.s;
     })
    },
    goto () {
     window.open('https://www.baidu.com/s?wd='   this.inputText, '_blank');
     this.inputText = '';
    },
    gotoItem(item) {
     window.open('https://www.baidu.com/s?wd='   item, '_blank');
     this.inputText = '';
    },
    down () {
     this.nowIndex  ;
     if (this.nowIndex == this.result.length) {
      this.nowIndex = -1;
      this.inputText = this.text;
     }
    },
    up () {
     this.nowIndex--;
     if (this.nowIndex < -1){
      this.nowIndex = -1;
      return;
     }
     if (this.nowIndex == -1) {
      this.nowIndex = this.result.length;
      this.inputText = this.text;
     }
    }
   }
  });
 }
 </script>
</head>

<body>
 <div id="box">
 <img src="https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png" width="270" height="129">
  <div>
   <div>
    <input 
     type="text" 
     class="input" 
     placeholder="请输入搜索内容 " 
     v-model='inputText' 
     @keyup='show($event)' 
     @keydown.down='down()' 
     @keydown.up.prevent='up()'
    >

     <input type="submit" value="百度一下" >

   </div>

   <ul>
    <li v-for="(item, index) in result" :class='{bgcolor: index==nowIndex}' @click="gotoItem(item)">
     {{item}}
    </li>
   </ul>
  </div>

 </div>
</body> 
</html>

如果所有表单元素都不想使用自动提示功能,只需在表单form上设置autocomplete=off。

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

必应:=

本文实例为大家分享了Vue.js实现tab滑块效果的具体代码,供大家参考,具体内容如下

<input type="text" name="name" autocomplete="off">

您可能感兴趣的文章:

  • Vue.js组件tabs实现选项卡切换效果
  • vue插件tab选项卡使用小结
  • Vue.js组件tab实现选项卡切换
  • 使用vue.js写一个tab选项卡效果
  • 基于Vue实现tab栏切换内容不断实时刷新数据功能
  • vue分页组件table-pagebar使用实例解析
  • vue2.0使用Sortable.js实现的拖拽功能示例
  • Vue.js tab实现选项卡切换
  • 基于vue2的table分页组件实现方法
  • bootstrap vue.js实现tab效果

最后将获取到的关键字提示放到input下面的节点中即可。

本文由全球彩票平台发布于全球彩官网下载地址Web前端,转载请注明出处:【全球彩官网下载地址】基于vue实现多引擎搜索

TAG标签: 全球彩票平台
Ctrl+D 将本页面保存为书签,全面了解最新资讯,方便快捷。