Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
vue-i18n-composable
Advanced tools
Composition API for vue-i18n
in Vue 2.x
vue-i18n-composable@v1
: >=2.5 <=2.6
vue-i18n-composable@v2
: >=2.7 <3
npm i vue-i18n vue-i18n-composable
if you use Vue 2.5 - Vue 2.6, you need to install @vue/composition-api
npm i @vue/composition-api
// main.js
import Vue from 'vue'
import { createI18n } from 'vue-i18n-composable'
import App from './App.vue'
const i18n = createI18n({
locale: 'ja',
messages: {
en: {
language: 'English',
},
ja: {
language: '日本語',
},
},
})
const app = new Vue({
render: h => h(App),
i18n,
})
app.mount('#app')
In components:
<template>
<div>{{ t('language') }}</div>
</template>
<script>
import { defineComponent } from 'vue'
import { useI18n } from 'vue-i18n-composable'
export default defineComponent({
setup() {
return {
...useI18n()
}
}
})
</script>
// main.js
import Vue from 'vue'
import VueCompositionAPI, { createApp } from '@vue/composition-api'
import { createI18n } from 'vue-i18n-composable'
import App from './App.vue'
Vue.use(VueCompositionAPI)
const i18n = createI18n({
locale: 'ja',
messages: {
en: {
language: 'English',
},
ja: {
language: '日本語',
},
},
})
const app = createApp({
render: h => h(App),
i18n,
})
app.mount('#app')
In components:
<template>
<div>{{ t('language') }}</div>
</template>
<script>
import { defineComponent } from '@vue/composition-api'
import { useI18n } from 'vue-i18n-composable'
export default defineComponent({
setup() {
return {
...useI18n()
}
}
})
</script>
MIT License © 2020 Anthony Fu
FAQs
Composition API for vue-i18n in Vue 2.x
We found that vue-i18n-composable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.