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

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

I have a vue component with

 

gives

app.js:47961 [Vue war

5条回答
  •  抹茶落季
    2021-02-05 04:18

    Simplest way of providing global objects to the template is to place them in computed, like this:

    console: () => console. Same goes for window,

    computed: {
      console: () => console,
      window: () => window,
    }
    

    See it here.

提交回复
热议问题