徐总多门店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
yangsai c3106436ae 20141015 5 months ago
..
lib 20141015 5 months ago
src 20141015 5 months ago
CHANGELOG.md 20141015 5 months ago
LICENSE 20141015 5 months ago
README.md 20141015 5 months ago
package.json 20141015 5 months ago

README.md

🌐 vue-i18n-loader

CircleCI codecov npm

vue-i18n loader for custom blocks

💿 Installation

$ npm i --save-dev @kazupon/vue-i18n-loader

🚀 Usage

the below example thatApp.vue have i18n custom block:

Custom Blocks (Single File Components)

<i18n>
{
  "en": {
    "hello": "hello world!"
  },
  "ja": {
    "hello": "こんにちは、世界!"
  }
}
</i18n>

<template>
  <p>{{ $t('hello') }}</p>
</template>

<script>
export default {
  name: 'app',
  // ...
}
</script>

JavaScript

import Vue from 'vue'
import VueI18n from 'vue-i18n'
import App from './App.vue'

Vue.use(VueI18n)

const i18n = new VueI18n({
  locale: 'en',
  messages: {
    en: {
      // ...
    },
    ja: {
      // ...
    }
  }
})
new Vue({
  i18n,
  render: h => h(App)
}).$mount('#app')

Webpack Config

configure webpack config for vue-loader (v11.3 later):

module.exports = {
  module: {
    rules: [{
      test: /\.vue$/,
      loader: 'vue',
      options: {
        loaders: {
          i18n: '@kazupon/vue-i18n-loader'
        }
      }
    }]
  }
}

📜 Changelog

Details changes for each release are documented in the CHANGELOG.md.

💪 Contribution

Please make sure to read the Contributing Guide before making a pull request.

MIT