最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue.js實(shí)現(xiàn)h5機(jī)器人聊天(測試版)

 更新時(shí)間:2020年07月16日 09:30:04   作者:菜鳥老五  
這篇文章主要為大家詳細(xì)介紹了vue.js實(shí)現(xiàn)h5機(jī)器人聊天測試版,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了vue.js實(shí)現(xiàn)h5機(jī)器人聊天的具體代碼,供大家參考,具體內(nèi)容如下

<!DOCTYPE html>
<html>
 
 <head>
 <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
 <title>登錄</title>
 <link rel="stylesheet" href="css/mui.css" />
 </head>
 <style>
 page {
 background-color: #ececec;
 }
 
 .reply .pic,
 .send .pic {
 border-radius: 50%;
 padding: 10px;
 }
 
 .reply,
 .send {
 display: flex;
 }
 
 .reply .pic image,
 .send .pic image {
 border-radius: 50%;
 width: 80rpx;
 height: 80rpx;
 }
 
 .send {
 justify-content: flex-end;
 }
 
 .reply .content {
 padding: 10px 10px 10px 0;
 max-width: 480rpx;
 }
 
 .send .content {
 padding: 10px 0 10px 10px;
 max-width: 480rpx;
 }
 
 .reply .content .text,
 .send .content .text {
 background-color: #fff;
 border-radius: 5px;
 padding: 10px;
 font-size: 16px;
 }
 
 .send .content .text {
 background-color: #78fd75;
 }
 
 .sendMessage {
 display: flex;
 position: fixed;
 bottom: 0;
 left: 0;
 right: 0;
 padding: 10px;
 background-color: #fff;
 }
 
 .inputMsg {
 flex: 2;
 background-color: #fff;
 height: 30px;
 font-size: 16px;
 padding: 5px 10px;
 border-bottom: 1px solid #ddd;
 }
 
 .sendMessage {
 position: fixed;
 bottom: 0px;
 width: 100%;
 height: 60px;
 line-height: 60px;
 background-color: #4CD964;
 }
 
 #inputs {
 position: absolute;
 display: inline-block;
 width: 65%;
 height: 40px;
 background-color: #fff;
 border-radius: 3px;
 }
 
 #btn_submit {
 position: absolute;
 width: 100px;
 display: inline-block;
 right: 10px;
 height: 40px;
 background-color: #DD524D;
 border: 0px;
 text-align: center;
 color: #fff;
 }
 
 .image {
 
 width: 60px;
 border-radius: 50%;
 height: 60px;
 }
 </style>
 
 <body>
 <header class="mui-bar mui-bar-nav">
 <h1 class="mui-title">老五</h1>
 </header>
 <div class="mui-content">
 
 <!--chat.wxml-->
 <div id="cont">
 
 <div >
 
 <!--<div v-if="{{item.type == 1}}">-->
 <div class="reply">
 <div class="pic">
 <image class="image" src="img/list_img.png"></image>
 </div>
 <div class="content">
 <div class="text">
 {{hh}}
 </div>
 </div>
 </div>
 <!--</div>-->
 <!--<div v-if="{{item.type == null}}">-->
 <div class="send">
 <div class="content">
 <div class="text">
 {{names}}
 </div>
 </div>
 <div class="pic">
 <image class="image" src="img/list_img.png"></image>
 </div>
 </div>
 <!--</div>-->
 </div>
 
 <div class="sendMessage">
 <input id="inputs" type="text" placeholder="請輸入您要說的話" />
 <button id="btn_submit" @click="mit()">發(fā)送</button>
 
 </div>
 
 </div>
 
 <!--<scroll-view scroll-y="true" style='margin-bottom:120rpx;' scroll-top="{{scrollTop}}">-->
 <!--<div is="temp" data="{{message}}"></div>-->
 <!--</scroll-view>-->
 
 </div>
 
 <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
 
 <script src="https://cdn.jsdelivr.net/npm/vue"></script>
 <script type="text/javascript" src="js/vue.min.js"></script>
 
 <script>
var str="";
 
 var vue = new Vue({
 el: "#cont",
 data: {
 message: [
 
 ],
 names: "what",
 hh:"你說啥",
 inputMsg: "",
 scrollTop: 0
 },
 methods: {
 mit: function() {
 var name = document.getElementById("inputs").value;
 console.log(name);
 if(name != "") {
 var msg = {
 type: 0,
 src: "http://tu.maomaogougou.cn/picture/2015/05/fa44ab7e634cbc7a8011939273b70375.jpg",
 texts: name
 };
 // //發(fā)送信息
 // this.Message(msg);
 // 1111111 console.log("124313535",this.names)
 this.names = name;
document.getElementById("inputs").value="";
 //回復(fù)
 $.ajax({
 type: "get",
 url: "http://www.tuling123.com/openapi/api",
 data: {
  key: "fa7f4d06b0a24b479d29ea0a01672350",
  info: msg.content
 },
 success: function(data) {
  console.log(data, "111111111111");
//  var reply = {
//  type: 1,
//  src: "http://tu.maomaogougou.cn/picture/2015/05/c53b650c3a5fd847688118e566d6673f.png",
//  content: data.text
//  };
 
str=data.text;
 
 }
 });
 
 
 }
 
 console.log(str,"str");
 this.hh=str; 
 // this.Messages(reply);
 },
// Message: function(msg) {
// var list = this.message;
// list.push(msg);
// this.message = list;
// console.log("Message", list);
//
// },
// Messages: function(msg) {
// var list = this.message;
// list.push(msg);
// this.message = list;
// console.log("2222222222", list);
//
// },
 },
 
 });
 </script>
 <script>
 </script>
 </body>
 
</html>

關(guān)于vue.js組件的教程,請大家點(diǎn)擊專題vue.js組件學(xué)習(xí)教程進(jìn)行學(xué)習(xí)。

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • 基于vue3與supabase系統(tǒng)認(rèn)證機(jī)制詳解

    基于vue3與supabase系統(tǒng)認(rèn)證機(jī)制詳解

    這篇文章主要介紹了基于vue3與supabase系統(tǒng)認(rèn)證機(jī)制,,系統(tǒng)使用基于 JWT (JSON Web Token) 的認(rèn)證方式,提供了安全可靠的用戶身份管理機(jī)制,需要的朋友可以參考下
    2025-04-04
  • vue長列表優(yōu)化之虛擬列表實(shí)現(xiàn)過程詳解

    vue長列表優(yōu)化之虛擬列表實(shí)現(xiàn)過程詳解

    前端的業(yè)務(wù)開發(fā)中會(huì)遇到不使用分頁方式來加載長列表的需求,下面這篇文章主要給大家介紹了關(guān)于vue長列表優(yōu)化之虛擬列表實(shí)現(xiàn)的相關(guān)資料,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2022-08-08
  • vue-router 按需加載 component: () => import() 報(bào)錯(cuò)的解決

    vue-router 按需加載 component: () => import() 報(bào)錯(cuò)的解決

    這篇文章主要介紹了vue-router 按需加載 component: () => import() 報(bào)錯(cuò)的解決,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-09-09
  • Element中Slider滑塊的具體使用

    Element中Slider滑塊的具體使用

    這篇文章主要介紹了Element中Slider滑塊的具體使用,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-07-07
  • Vue3中使用reactive時(shí),后端有返回?cái)?shù)據(jù)但dom沒有更新的解決

    Vue3中使用reactive時(shí),后端有返回?cái)?shù)據(jù)但dom沒有更新的解決

    這篇文章主要介紹了Vue3中使用reactive時(shí),后端有返回?cái)?shù)據(jù)但dom沒有更新的解決,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-03-03
  • vue 解決provide和inject響應(yīng)的問題

    vue 解決provide和inject響應(yīng)的問題

    這篇文章主要介紹了vue 解決provide和inject響應(yīng)的問題,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-11-11
  • VUE實(shí)現(xiàn)日歷組件功能

    VUE實(shí)現(xiàn)日歷組件功能

    本篇文章主要介紹了VUE實(shí)現(xiàn)日歷組件功能,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-03-03
  • vue實(shí)現(xiàn)三級導(dǎo)航展示和隱藏

    vue實(shí)現(xiàn)三級導(dǎo)航展示和隱藏

    這篇文章主要為大家詳細(xì)介紹了vue實(shí)現(xiàn)三級導(dǎo)航展示和隱藏,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-08-08
  • vue 圖標(biāo)選擇器的實(shí)例代碼

    vue 圖標(biāo)選擇器的實(shí)例代碼

    本文通過實(shí)例代碼給大家介紹了vue 圖標(biāo)選擇器的相關(guān)知識(shí),圖文實(shí)例代碼相結(jié)合給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友參考下吧
    2021-11-11
  • ElementUI年份范圍選擇器功能實(shí)現(xiàn)

    ElementUI年份范圍選擇器功能實(shí)現(xiàn)

    elementUI中有日期范圍組件,月份范圍選擇的,就是沒有年份范圍選擇的,需要加一個(gè)類似風(fēng)格的,下面這篇文章主要給大家介紹了關(guān)于ElementUI年份范圍選擇器功能實(shí)現(xiàn)的相關(guān)資料,需要的朋友可以參考下
    2023-02-02

最新評論

女性| 灌云县| 常德市| 蛟河市| 枣庄市| 祁东县| 西充县| 贵州省| 双桥区| 洪湖市| 安顺市| 手游| 西和县| 高邑县| 昆山市| 双辽市| 罗城| 永善县| 富宁县| 拉萨市| 黑山县| 同德县| 镇巴县| 宁乡县| 法库县| 岐山县| 鹰潭市| 阿瓦提县| 乌鲁木齐县| 大兴区| 胶州市| 苏尼特左旗| 萨嘎县| 许昌市| 四子王旗| 卓尼县| 双辽市| 阳原县| 望城县| 乃东县| 晋城|