App.vue 499 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <div id="app">
  3. <router-view />
  4. </div>
  5. </template>
  6. <script>
  7. import util from "@/libs/util";
  8. export default {
  9. name: "app",
  10. watch: {
  11. "$i18n.locale": "i18nHandle",
  12. },
  13. created() {
  14. this.i18nHandle(this.$i18n.locale);
  15. },
  16. methods: {
  17. i18nHandle(val, oldVal) {
  18. util.cookies.set("lang", val);
  19. document.querySelector("html").setAttribute("lang", val);
  20. },
  21. },
  22. };
  23. </script>
  24. <style lang="scss" >
  25. @import "~@/assets/style/public-class.scss";
  26. </style>