JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q24853F
  • License ISC

an easy way to support multiple fonts for multiple languages in the same page.

Package Exports

  • vue-langstyle

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-langstyle) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Vue-langsStyle

an easy way to support multiple fonts for multiple languages in the same page.

installing

npm i vue-langstyle --save

vue cli installation

import Vue from 'vue'
import langStyle from 'vue-langstyle'

Vue.use(langStyle);
// the you can add configs

Nuxt installation

~/plugins/langStyle

import Vue from 'vue'
import langStyle from 'vue-langstyle'

Vue.use(langStyle);

~/nuxt.config.js

  plugins: [
    {src: "~/plugins/langStyle.js"}
  ],

style function

  style(text :string);
methods: {
  funcName() {
    this.text = this.$langStyle.style(this.text)
  }
}

Now you can specify the class name

this.$langStyle.config({Class: "zed"});

If you changed the default lang it will automatically set the lang to (Chinese/Korean/Japanese)

this.$langStyle.config({lang:"ch",Class: "zed"});

then you can style by the class name

.zed {
  font-size: 20px;
  color: red
}
  <p v-html="text"></p>

Now you can use customLang function

customLang function
  customLang({
    Regex :string Regular expression for the language or the word,
    Class :string The class will be given to the language or word (Optional Default "custom"),
    Text :string The article body or the content that will be changed
  })
  this.text = this.$langStyle.customLang({Regex: /[\u0600-\u06FF]/,Class: "zed", Text: this.text});

Tasks List

  • Adding support for Arabic
  • Adding Class method
  • Adding support for Chinese
  • Adding support for Japanese
  • Adding support for Korean
  • Adding support for Latin`s Languages

Deprecated

Attr method you can only use class method now