解决ElementUI的脚本报错Cannot read property adornUrl of undefined

最近学习VUE结合ElementUI框架,在写函数的时候需要发一个post请求,但是之前的post请求都没问题,就这个post突然报错Cannot read property ‘adornUrl’ of undefined

TypeError: Cannot read property 'adornUrl' of undefined
    at VueComponent.addCategory (category.vue?db70:81)
    at VueComponent.invoker (vue.esm.js?efeb:2027)
    at VueComponent.Vue.$emit (vue.esm.js?efeb:2538)
    at VueComponent.handleClick (button.js?9ada:312)
    at invoker (vue.esm.js?efeb:2027)
    at HTMLButtonElement.fn._withTask.fn._withTask (vue.esm.js?efeb:1826)

问题JS写法

this.http({
          url: this.http.adornUrl("/product/category/save"),
          method: 'post',
          data: this.http.adornData(this.category, false)
     }).then(({ data }) => {...});

woca我的http前面的$ 符 号 呢 ? 这 里 使 用 的 v s c o d e , 把 一 些 常 用 的 脚 本 或 者 方 法 放 在 用 户 片 段 , 打 关 键 字 就 可 以 快 速 引 用 你 封 装 的 代 码 块 , 比 如 p o s t 请 求 g e t 请 求 等 等 。 这 里 系 统 自 动 把 我 的 符号呢?这里使用的vscode,把一些常用的脚本或者方法放在用户片段,打关键字就可以快速引用你封装的代码块,比如post请求get请求等等。这里系统自动把我的 ?使vscode,postget符号给去了,好坑,因为vscode使用 作 为 占 位 符 , 如 作为占位符,如 {1}或者$ 1 , 都 可 以 让 你 的 用 户 片 段 在 加 载 后 直 接 把 鼠 标 光 标 放 到 那 里 , 所 以 需 要 加 1,都可以让你的用户片段在加载后直接把鼠标光标放到那里,所以需要加 1才能正常加载。

"Print to console": {
		"prefix": "$httppost",
		"body": [            		
			"this.$$http({",
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值