Subscribe on changes!

Line breaks cannot be used as statement delimiters

avatar
Jul 13th 2021

Version

3.1.4

Reproduction link

sfc playground

Steps to reproduce

<template>
  <div>
    <p>{{msg}}</p>
    <button @click="
        msg=msg msg
        getconsole()
      ">click_test</button>
  </div>
</template>

<script>
export default {
  name: "click_test",
  data(){
    return{
      msg:'test'
    }
  },
  methods:{
    getconsole(){
      console.log("click function")
    }
  }
}
</script>

What is expected?

do not need to add ';'

What is actually happening?

when npm run serve,it will have a wrong message. Must add a ';' or ',' between "msg=msg msg" and " getconsole()". the ';' is not necessary in vue2

avatar
Jul 13th 2021

That's a won't fix. Just use a semicolon.