【问题标题】:(NUXT) How to add component in sweet alert 2(NUXT) 如何在甜蜜警报 2 中添加组件
【发布时间】:2020-07-17 07:54:33
【问题描述】:

我尝试通过以下方法在swal中添加一个组件。

this.$swal({ html: '<Card :assignment="{}"></Card>' })

但它最终给了我这个错误,

error: The "Card" component has been registered but not used  vue/no-unused-components  

任何线索将不胜感激

【问题讨论】:

    标签: vue.js nuxt.js sweetalert2


    【解决方案1】:

    您收到的错误只是抛出的 linting 错误。它被抛出是因为 linter 期望您在标签内使用 Card 组件。

    尝试以下方法:

    // inside your Vue component
    
    components: { 
    // eslint-disable-next-line vue/no-unused-components
      Card 
    }
    
    

    【讨论】:

      猜你喜欢
      • 2022-08-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-08
      • 2023-03-20
      • 2018-07-25
      相关资源
      最近更新 更多