【问题标题】:props keep showing as $attrs in VUE DEV TOOLSprops 在 VUE DEV TOOLS 中一直显示为 $attrs
【发布时间】:2021-10-29 16:19:12
【问题描述】:

enter image description hereenter image description here 我的道具在 VUE DEV TOOLS 中一直显示为 $attrs 我尝试使用 inheritAttrs: false 和 v-bind="$attrs" 禁用 attrs,不起作用

// props 
:showLoadMoreButton="load"

  data() {
    return {
      load: true
  }

【问题讨论】:

    标签: vue.js vue-component vuex vuejs3 vuejs-transition


    【解决方案1】:

    如果某物作为属性出现,则意味着它没有注册为组件上的道具。

    尝试将您不需要的属性注册为道具:

    // props 
    :showLoadMoreButton="load"
    
    export default {
      props: {
        showLoadMoreButton: Boolean
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2021-09-19
      • 1970-01-01
      • 2022-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-13
      • 2020-10-01
      相关资源
      最近更新 更多