how can I use console.error or console.log in a vue template?

后端 未结 5 1875
自闭症患者
自闭症患者 2021-02-05 03:44

I have a vue component with

 

gives

app.js:47961 [Vue war

5条回答
  •  情歌与酒
    2021-02-05 04:20

    If you want to run it inline instead of using a method, just add this to the form:

    Codepen: https://codepen.io/x84733/pen/PaxKLQ?editors=1011

    
      First: 
    Second:

    But it'd be better to use a method instead of running functions inline, so you have more control over it:

    
    
    First:
    Second:
    ... methods: { debug (event) { console.log(event.target.name) } }

提交回复
热议问题