vue根据ajax绑定数数。。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>User List</title>
<link href="/css/publicCSS.css" rel="stylesheet" type="text/css">
<link href="/css/font-all.css" rel="stylesheet" type="text/css">
<script src=/js/jquery.min.js"></script>
<script src=/js/layer/layer.js"></script>
<script src="https://vuejs.org/js/vue.min.js"></script>
</head>
<body>
<!--表格样式1-->
<div class="panel_ZH">
<div class="line_header"><i class="fas fa-table"></i> 表格1
<div class="line_header_R"><i class="fas fa-plus"></i> <i class="fas fa-caret-left"></i> <i
class="fas fa-caret-down"></i> <i class="fas fa-caret-right"></i> <i class="fas fa-chevron-up"></i> <i
class="fas fa-chevron-down"></i> <i class="fas fa-chevron-left"></i> <i
class="fas fa-chevron-right"></i> <i class="fas fa-check"></i></div>
</div><!--line_header-->
<table class="table201801" id="userList">
<tbody>
<tr>
<th>操作</th>
<th>账号</th>
<th>中文名</th>
<th>英文名</th>
<th>所属公司</th> <th>所属平台</th>
<th>是否有效</th>
<th>最后登录时间</th>
<th>创建人</th>
<th>创建时间</th>
</tr>
<tr v-for="item in userList">
<td><i class="fas fa-pencil-alt"></i> <i class="fas fa-trash-alt"></i></td>
<td>{{item.account}}</td>
<td>{{item.userNameCn}}</td>
<td>{{item.userNameEn}}</td>
<td>{{item.companyId}}</td>
<td>{{item.platformId}}</td> <td>{{item.isValid}}</td>
<td>{{item.lastLoginTime}}</td>
<td>{{item.createUserId}}</td>
<td>{{item.createTime}}</td> </tr> </tbody>
</table><!--table201801-->
</div><!--panel_ZH-->
</body>
</html>
<script>
//不用ajax调数直接用json当数据
var v1=new Vue({
el:"#userList",
data:{
userList:[]//[{"account":"admin","companyId":0,"createTime":"2018-07-31 09:24:24","createUserId":0,"isValid":1,"lastLoginTime":null,"platformId":1,"remark":"","roleIdstr":"","updateTime":null,"updateUserId":0,"userId":1,"userNameCn":"管理员","userNameEn":"Administrator"},{"account":"admin2","companyId":1,"createTime":"2018-07-31 09:24:24","createUserId":0,"isValid":1,"lastLoginTime":null,"platformId":1,"remark":"","roleIdstr":"","updateTime":null,"updateUserId":0,"userId":2,"userNameCn":"管理员2","userNameEn":"Administrator2"}]
}
}); $(function () {
loadData();
}); function loadData() {
var postdata = {pageIndex: "1"};
$.ajax3({
url: "/webapi/getlist",
data:postdata,
success: function (r) {
console.log("OK"+JSON.stringify(r))
if (r != null && r.code == 1 && r.data.list.length>0) {
console.log("list:"+JSON.stringify(r.data.list))
v1.userList=r.data.list;
//bindData(r.data);
} }
});
} </script>
vue根据ajax绑定数数。。的更多相关文章
- Vue.js双向绑定的实现原理和模板引擎实现原理(##########################################)
Vue.js双向绑定的实现原理 解析 神奇的 Object.defineProperty 这个方法了不起啊..vue.js和avalon.js 都是通过它实现双向绑定的..而且Object.obser ...
- 从零开始学 Web 之 Vue.js(四)Vue的Ajax请求和跨域
大家好,这里是「 从零开始学 Web 系列教程 」,并在下列地址同步更新...... github:https://github.com/Daotin/Web 微信公众号:Web前端之巅 博客园:ht ...
- vue使用ajax
1.Vue的Ajax基本用法 在vue中用Ajax需要用到vue.js和vue-resource.js; vue-resource.js的下载地址:https://cdn.staticfile.org ...
- Vue.js双向绑定的实现原理
Vue.js最核心的功能有两个,一是响应式的数据绑定系统,二是组件系统.本文仅探究几乎所有Vue的开篇介绍都会提到的hello world双向绑定是怎样实现的.先讲涉及的知识点,再参考源码,用尽可能少 ...
- 【BZOJ】【3530】【SDOI2014】数数
AC自动机/数位DP orz zyf 好题啊= =同时加深了我对AC自动机(这个应该可以叫Trie图了吧……出边补全!)和数位DP的理解……不过不能自己写出来还真是弱…… /************* ...
- Jquery ajax 绑定multiselect多选下拉选项,同时异步执行返回值
Jquery ajax 绑定multiselect多选下拉选项,同时异步执行获取返回值 function load(mslt_employees,belongto,mark) {//传入$(#ID) ...
- BZOJ3530: [Sdoi2014]数数
3530: [Sdoi2014]数数 Time Limit: 10 Sec Memory Limit: 512 MBSubmit: 322 Solved: 188[Submit][Status] ...
- 【HDU3530】 [Sdoi2014]数数 (AC自动机+数位DP)
3530: [Sdoi2014]数数 Time Limit: 10 Sec Memory Limit: 512 MBSubmit: 682 Solved: 364 Description 我们称一 ...
- COJ 0036 数数happy有多少个?
数数happy有多少个? 难度级别:B: 运行时间限制:1000ms: 运行空间限制:51200KB: 代码长度限制:2000000B 试题描述 图图是个爱动脑子.观察能力很强的好学生.近期他正学英语 ...
随机推荐
- 关于boostrap的modal隐藏问题(前端框架)
Modal(模态框) 首先,外引boostrap和Jquery的文件环境: <link rel="stylesheet" href="https://cdn.sta ...
- 测者的测试技术手册:智能化测试框架EvoSuite的一个坑以及填坑方法
问题 最近在不断地学习和探索EvoSuite框架的时候,在生产JUnit单元测试框架后,出现如下问题: Exception: Caused by: org.evosuite.runtime.TooMa ...
- Storm入门(一)原理介绍
问题导读:1.hadoop有master与slave,Storm与之对应的节点是什么?2.Storm控制节点上面运行一个后台程序被称之为什么?3.Supervisor的作用是什么?4.Topology ...
- Generetor函数与线程之间的思考
在解析这个问题之前,首先,我们来了解一下es6标准里新增解决异步的两种规范 Promise与Generetor Promise 其实Promise的本质 还是基于js程式的回调处理----这一点看它的 ...
- iOS CATransition 自定义转场动画
https://www.jianshu.com/p/39c051cfe7dd CATransition CATransition 是CAAnimation的子类(如下图所示),用于控制器和控制器之间的 ...
- Appuim的安装步骤
1.下载Appium Desktop并安装 下载地址:https://github.com/appium/appium-desktop/releases 我下载的版本为:appium-desktop- ...
- Google SRE
SRE_百度百科 https://baike.baidu.com/item/SRE/1141123 我们离Google SRE还有多远? - 简书https://www.jianshu.com/p/6 ...
- sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified | 学步园 https://www.xuebuyuan.com/2157339.html 通 ...
- json打不开
- 基于.NET平台的Ocelot网关框架教程汇总
Ocelot 框架是基于.NET 开发的 API 网关,API网关是系统内部服务暴露在外部的一个访问入口,类似于代理服务器,就像一个公司的门卫承担着寻址.限制进入.安全检查.位置引导等工作,我们可以形 ...