Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

记录 Vue 使用报错的不完整指南 #93

Open
iiuhuy opened this issue Jul 8, 2020 · 0 comments
Open

记录 Vue 使用报错的不完整指南 #93

iiuhuy opened this issue Jul 8, 2020 · 0 comments
Labels

Comments

@iiuhuy
Copy link
Owner

iiuhuy commented Jul 8, 2020

记录 Vue 使用报错的不完整指南

1.Vue 循环报错:You may have an infinite update loop in a component

微信截图_15941097845622

我在 v-for 循环的 tag 组件中绑定了 methods 的函数,这个函数的作用是返回不同的颜色展示的内容。

<div class="sx_work_title">
  <div>{{ showData.title }}</div>
  <van-tag :color="tagColor" plain>{{ tagType(showData.tag) }}</van-tag>
</div>

tagColor 在 data 对象中声明了,导致我在 tagType 方法直接使用 this.tagColor 的时候就会报上面的警告。对对象进行克隆并不能解决这 warn。把这个变量放到函数内部定义,而不在 data 对象中去声明。

tagColor(tag) {
  switch (tag) {
    case 1:
      return '#C79819'
      break
    case 2:
      return '#259E15'
      break
    default:
      break
  }
},

2.emitting CopyPlugin

一直加载不出来:

image

原因:import 为空

import { login } from "";
@iiuhuy iiuhuy added the Vue label Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant