Skip to content

Vue:Components:App

JavaScript

export default {
  name: "App",
  components: {},
  data() {
    return {};
  },
  methods: {},
  computed: {
    dark() {
      return this.$vuetify.theme.dark;
    },
  },
  watch: {
    dark() {
      this.$vuetify.theme.dark = this.dark;
    },
  },
  created() {
    // this.$api.setUrl(this.$local.getters['etc/getApiUrl']);
  },
  mounted() {
    this.$vuetify.lang.current = "ko";
    this.$i18n.locale = this.$store.getters["language/getLanguage"];
    this.$api.setUrl(this.$localStore.getters["etc/getApiUrl"]);
  },
  beforeDestroy() {},
};

TypeScript

위의 #JavaScript 버전을 TypeScript 버전으로 변경하면 다음과 같다:

import { Vue, Component, Watch } from "vue-property-decorator"

@Component
export default class App extends Vue {
  created() {
    // this.$api.setUrl(this.$local.getters['etc/getApiUrl']);
  }

  mounted() {
    this.$vuetify.lang.current = "ko";
    this.$i18n.locale = this.$store.getters["language/getLanguage"];
    this.$api.setUrl(this.$localStore.getters["etc/getApiUrl"]);
  }

  beforeDestroy() {
    // EMPTY.
  }

  get dark(): boolean {
    return this.$vuetify.theme.dark;
  }

  @Watch("dark")
  onChangedDark() {
    this.$vuetify.theme.dark = this.dark;
  }
}

See also