Aby-Chan
Aby-Chan

Reputation: 605

emacs web-mode indent javascript not correct

web mode indent not correct when line too long. the code:

<script>
  import axios from 'axios'

  export default {
    components: {

    },
    asyncData ({ params }) {

      return axios
        .get().then((res) => {
          return { title: res.data.title }
      })
    }
  }
</script>

The following is correct.

      return axios
        .get().then((res) => {
          return { title: res.data.title }
      })

but:

      return axios.get()
             .then((res) => {
          return { title: res.data.title }
      })

when i break line behind "axios", it's not correct

anybody help??

Upvotes: 0

Views: 165

Answers (1)

Aby-Chan
Aby-Chan

Reputation: 605

Ah... I found it.

(add-to-list 'web-mode-indentation-params '("lineup-calls" . nil))

Upvotes: 2

Related Questions