【问题标题】:How to pass props to component when used with Quasar dialog plugin与 Quasar 对话框插件一起使用时如何将道具传递给组件
【发布时间】:2019-10-18 10:03:39
【问题描述】:

根据quasar docs,与dialog plugin 一起使用的自定义组件可以有props。但我看不到如何通过

将这些道具传递给组件
this.$q.dialog({component: CustomComponent,})

【问题讨论】:

    标签: vue.js quasar


    【解决方案1】:

    docs 状态,您可以在逗号后添加它们,如下所示:

      this.$q.dialog({
      component: CustomComponent,
    
      // optional if you want to have access to
      // Router, Vuex store, and so on, in your
      // custom component:
      parent: this, // becomes child of this Vue node
                    // ("this" points to your Vue component)
                    // (prop was called "root" in < 1.1.0 and
                    // still works, but recommending to switch
                    // to the more appropriate "parent" name)
    
      // props forwarded to component
      // (everything except "component" and "parent" props above):
      text: 'something',
      // ...more.props...
    

    【讨论】:

    • 所以“文本”是“自定义组件”的道具。谢谢
    猜你喜欢
    • 1970-01-01
    • 2020-12-01
    • 2020-12-30
    • 1970-01-01
    • 1970-01-01
    • 2018-08-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多