vue ajax不更新,javascript - vuejs ajax获取数据 dom不更新
我网上下载得 Vue.js 高仿饿了么外卖 App
data.json 修改了,但是dom不更新, 求大神解答!!!
{
"seller": {
"name": "粥品香坊(回龙观)",
"description": "蜂鸟专送111111",
"deliveryTime": 38,
"score": 4.2,
"serviceScore": 4.1,
"foodScore": 4.3,
"rankRate": 69.2,
"minPrice": 20,
"deliveryPrice": 4,
"ratingCount": 24,
"sellCount": 90,
"bulletin": "粥品香坊其烹饪粥料的秘方源于中国千年古法,在融和现代制作工艺,由世界烹饪大师屈浩先生领衔研发。坚守纯天然、0添加的良心品质深得消费者青睐,发展至今成为粥类的引领品牌。是2008年奥运会和2013年园博会指定餐饮服务商。",
"supports": [
{
"type": 0,
"description": "在线支付满28减5"
},
{
"type": 1,
"description": "VC无限橙果汁全场8折"
},
{
"type": 2,
"description": "单人精彩套餐"
},
{
"type": 3,
"description": "该商家支持发票,请下单写好发票抬头"
},
{
"type": 4,
"description": "已加入“外卖保”计划,食品安全保障"
}
],
"avatar": "http://static.galileo.xiaojukeji.com/static/tms/seller_avatar_256px.jpg",
"pics": [
"http://fuss10.elemecdn.com/8/71/c5cf5715740998d5040dda6e66abfjpeg.jpeg?imageView2/1/w/180/h/180",
"http://fuss10.elemecdn.com/b/6c/75bd250e5ba69868f3b1178afbda3jpeg.jpeg?imageView2/1/w/180/h/180",
"http://fuss10.elemecdn.com/f/96/3d608c5811bc2d902fc9ab9a5baa7jpeg.jpeg?imageView2/1/w/180/h/180",
"http://fuss10.elemecdn.com/6/ad/779f8620ff49f701cd4c58f6448b6jpeg.jpeg?imageView2/1/w/180/h/180"
],
"infos": [
"该商家支持发票,请下单写好发票抬头",
"品类:其他菜系,包子粥店",
"北京市昌平区回龙观西大街龙观置业大厦底商B座102单元1340",
"营业时间:10:00-20:30"
],
"choosePlace": [
"福楼1号菜桌",
"会议楼露厅",
"会议楼一层大圆桌"
]
},
}
入口:APP.vue
商品
评论
商家
import {urlParse} from 'common/js/util';
import header from 'components/header/header.vue';
const ERR_OK = 0;
export default {
data() {
return {
seller: {
id: (() => {
let queryParam = urlParse();
return queryParam.id;
})()
}
};
},
created() {
this.$http.get('/api/seller?id=' + this.seller.id).then((response) => {
response = response.body;
if (response.errno === ERR_OK) {
this.seller = Object.assign({}, this.seller, response.data);
}
});
},
components: {
'v-header': header
}
};
@import "./common/stylus/mixin.styl"
.tab
display: flex
width: 100%
height: 40px
line-height: 40px
// border-bottom: 1px solid rgba(7, 17, 27, 0.1)
border-1px(rgba(7, 17, 27, 0.1))
.tab-item
flex: 1
text-align: center
& > a
display: block
font-size: 14px
color: rgb(77, 85, 93)
&.active
color: rgb(240, 20, 20)
header.vue
商品
评论
商家
import {urlParse} from 'common/js/util';
import header from 'components/header/header.vue';
const ERR_OK = 0;
export default {
data() {
return {
seller: {
id: (() => {
let queryParam = urlParse();
return queryParam.id;
})()
}
};
},
created() {
this.$http.get('/api/seller?id=' + this.seller.id).then((response) => {
response = response.body;
if (response.errno === ERR_OK) {
this.seller = Object.assign({}, this.seller, response.data);
}
});
},
components: {
'v-header': header
}
};
@import "./common/stylus/mixin.styl"
.tab
display: flex
width: 100%
height: 40px
line-height: 40px
// border-bottom: 1px solid rgba(7, 17, 27, 0.1)
border-1px(rgba(7, 17, 27, 0.1))
.tab-item
flex: 1
text-align: center
& > a
display: block
font-size: 14px
color: rgb(77, 85, 93)
&.active
color: rgb(240, 20, 20)
vue ajax不更新,javascript - vuejs ajax获取数据 dom不更新相关推荐
- Vue组件设置缓存kepp-alive 后如何获取数据
Vue组件设置缓存kepp-alive 后如何获取数据 解决方案 : beforeRouteEnter activated beforeRouteEnter 每次进去组件渲染时,都会执行beforeR ...
- Vue:echarts画图实战,异步获取数据在Vue上使用echarts进行画图
Vue:echarts画图实战,异步获取数据在Vue上使用echarts进行画图 一.效果图 二.资源 主题编辑器 ECharts 教程 实现代码------想要进行实战的同学可以研究以下代码,下面的 ...
- ajax请求获取服务器数据,jquery.ajax发布从app引擎服务器获取数据的请求
为noob问题道歉...... 您好,如何使用jQuery.ajax从appengine服务器的Python端获取数据?我知道如何使用ajax和适当的处理程序将数据发送到服务器,但我想知道是否有人可以 ...
- apiCloud中api.ajax方法跨域传参获取数据
apiCloud中的ajax方法,可以自动处理跨域访问数据,不必使用jsonp来处理了. 使用ajax方法,必须要在apiready = function() {}方法中 获取参数 var pageP ...
- 表单和ajax中的post请求后台获取数据方法(深度好文)
最近要做后台数据接收,因为前台传来的数据太过于混乱,所以总结了一下前台数据post请求方法,顺便写了下相对应的后台接收方法. 前台主要的contenttype为下面三种:(需要注意的是请求头中data ...
- vue使用echarts是,动态获取数据,动态更新图表数据。
当我们初始化完数据后,需要更新数据时,虽然请求成功,获取到新的数据.但是echarts的图表没有根据数据更新而更新,原因是数据更新了,但echarts还是初始化时的那个. 我们可以在请求成功后,重新初 ...
- vue根据url获取内容axios_使用Vue.js和Axios从第三方API获取数据 — SitePoint
更多的往往不是,建立你的JavaScript应用程序时,你会想把数据从远程源或消耗一个[ API ](https:/ /恩.维基百科.org /维基/ application_programming_ ...
- vue中拿到接口,并获取数据,渲染到页面
首先index.html完成的是单页面展示,app.vue里面已经写了视图出口, 例如;先新建一个role.vue页面,写上相应的布局和内容,然后在路由中添加这个页面. 然后开始写渲染数据的方法 前提 ...
- ajax写入txt,javascript结合ajax读取txt文件内容
代码很简洁,这里就不多废话了,直接上源码 html代码 代码如下: 请求数据 function show(){ Ajax('read.txt?datetime=new Date.getTime ',f ...
最新文章
- 目标检测推理部署:优化和部署
- JS 中如何判断 undefined 和 null
- 【BZOJ2631】tree (LCT)
- android 骨骼动画库,cocos creator spine骨骼动画组件使用
- python全栈-Day 1
- 基础算法 —— 高精度计算
- 19楼网站服务器配置,简单的DNS 服务器配置
- 花式上分算法大赛,速看鹅厂六强团队解题思路集锦【附PPT下载】
- 今天我们开通知识星球了~
- fatal error: highgui.h: No such file or directory
- VB.net:VB编程语言/VB.net语言编程的简介、IDE安装、学习路线(几十项案例代码实现)之详细攻略
- 龙门飞甲的一点小小感想
- 宇枫资本你需要了解的三个理财点
- JUC的常用辅助工具
- 乒乓球十一分制比赛规则_乒乓球赛制 乒乓球十一分制比赛规则
- 2个鸡蛋,100层楼问题;
- 一文搞定 Spring Security 异常处理机制!
- PCIe ECAM机制访问PCIE的配置空间
- pinyin4j新手教程
- 区块链Fabric 技术架构和交易流程