search

Home  >  Q&A  >  body text

javascript - How should anonymous functions in vueJS obtain the context of Component?

There is the following configuration. If you want to generate a button based on the configuration, how can you pass in the context of this control? Or is there a better way to implement it?
Wait online for ten minutes~

        buttons: [{
                    action: function (context) {
                         
                    },
                    text: "查询"
                }, {
                    action: function (context) {
                        
                    },
                    text: "重置"
                }]
大家讲道理大家讲道理2819 days ago772

reply all(1)I'll reply

  • 世界只因有你

    世界只因有你2017-07-05 10:41:39

    Use mixins

    reply
    0
  • Cancelreply