Skip to content

Vue 3 docs are a lot more confusing than vue 2 docs about how we should code #1167

Closed
@yann-yinn

Description

@yann-yinn

Hi there, (sorry for my inaccurate language, i'm french)

First i want to say how much Vue 3 is better than Vue 2, and how much I love the new composition API; and i know how fucking hard it is to write documentation; kudos for brave people working hard on this.

This issue is pretty meta and only about one thing:

When i first read Vue 2 docs, i was super happy: I knew exactly how to code and, from day one, I was able to code in production. It was so easy: option API, data() for reactivity, no TypeScript, Vuex if I need state management, and i can use <style scoped> for CSS. Let's go ! Code, git push, this is in prod, i'm a Vue developper \o/

But learning Vue 3 and reading the (very good) docs, i was confused because I didn't know how I was suppose to code anymore:

  • Should I use only composition API ? ( my answer today is "yes" and "do not use option API anymore")
  • Shoud I use TypeScript or not when starting a new Projet ? Vue 3 has be rewritten in TypeScript, but should i use it ? (my answer today is "yes, you should")
  • if TypeScript, should I use "class component" or not ? (my answer is "no" for now)
  • ref() or reactive() ? Technically, i can use objects with ref() AND reactive. Still not sure about when I shoud use one or the other, sometimes i switch from one to the other... (i'm tempted to use only ref, writing ".value" is not so annoying and at least we know that we MUST always write value, from computed to reactive variables)
  • script or <script setup> ? If i'm using only composition API, should i write always "export default {setup()}" or should i use <script setup> ? My VSCode editor seems happier with keeping "export default {setupt()}" notation...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions