Skip to content

Instantly share code, notes, and snippets.

View titusdecali's full-sized avatar
🖖

Titus Decali titusdecali

🖖
View GitHub Profile
@titusdecali
titusdecali / i18n.js
Created November 25, 2020 09:57
config for vue-i18n
import Vue from "vue";
import VueI18n from "vue-i18n";
Vue.use(VueI18n);
// On change of language, switch the /locals/_language_.json file
function loadLocaleMessages() {
const locales = require.context(
"./locales",
true,
@titusdecali
titusdecali / .vue-translation.js
Last active November 25, 2020 09:55
config file for vue-translation-manager
const path = require("path");
const { JSONAdapter } = require("vue-translation-manager");
module.exports = {
srcPath: path.join(__dirname, "src/"),
adapter: new JSONAdapter({
path: path.join(__dirname, "src/locales/"),
}),
languages: ["ko", "en", "es", "ja", "zh"],
};
@titusdecali
titusdecali / VueTabs.vue
Last active March 2, 2020 04:10
Tabbed Section in Vue using class binding
<template>
<div id="tabs" class="container">
<div class="tabs">
<a v-on:click="activetab=1" v-bind:class="[ activetab === 1 ? 'active' : '' ]">Tab 1</a>
<a v-on:click="activetab=2" v-bind:class="[ activetab === 2 ? 'active' : '' ]">Tab 2</a>
<a v-on:click="activetab=3" v-bind:class="[ activetab === 3 ? 'active' : '' ]">Tab 3</a>
</div>
<div class="content">