• 카테고리

    질문 & 답변
  • 세부 분야

    프론트엔드

  • 해결 여부

    미해결

변수명에,

19.09.14 17:52 작성 조회수 96

1

카멜 스타일이랑 그냥 소문자로 시작하시는 경우가 있는데요, 어떤 기준이신지 궁금합니다.

대표적으로 아래의 경우, User, Comments, Images는 대문자로 시작하고 id , content는 소문자로 시작하는데요.

onSubmitForm() {
      if (this.$refs.form.validate()) {
        this.$store
          .dispatch("posts/add", {
            content: this.content,
            User: {
              nick: this.me.nick
            },
            Comments: [],
            Images: [],
            id: Date.now(),
            createdAt: Date.now()
          })
          .then(() => {
            this.content = "";
            this.hideDetails = false;
            this.success = true;
            this.successMessages = "Post Success MSG";
          })
          .catch(() => {});
      }
    }

답변 1

답변을 작성해보세요.

1

User, Comments, Images는 나중에 시퀄라이즈(DB ORM)에서 저렇게 대문자로 넣어줍니다. JOIN한 결과물입니다.