vue-lang-code-flags (vue-lang-code-flags)
Vue component which shows the flag of the country from which the language comes from.
Vue组件,显示语言来源国的国旗。
如何安装 (How to install)
Get the package from NPM:
从NPM获取软件包:
npm install vue-lang-code-flags
or
yarn add vue-lang-code-flags
如何使用 (How to use)
Register LangFlag
component in your app. You can use two approaches:
在您的应用程序中注册LangFlag
组件。 您可以使用两种方法:
in
main.js
you can mount it as a global Vue component:在
main.js
您可以将其安装为全局Vue组件:
import Vue from 'vue'
import LangFlag from 'vue-lang-code-flags'
Vue.component('lang-flag', LangFlag)
in a specific component (e.g.:
Component.vue
):在特定组件中(例如:
Component.vue
):
import LangFlag from 'vue-lang-code-flags'
new Vue({
components: {
LangFlag
}
})
Then, after the proper mounting, in your template you can call it like this:
然后,在正确安装之后,可以在模板中这样称呼它:
<lang-flag iso='en'/>
<lang-flag iso='ja' squared="false"/>
<lang-flag iso='zh' title="Some title"/>
API (API)
Mandatory properties
强制性
Property | Description | Type | Value |
---|---|---|---|
iso | ISO 639-1 identifier of the language | String | one of the values defined here |
属性 | 描述 | 类型 | 值 |
---|---|---|---|
iso | ISO 639-1语言标识符 | String | 此处定义的值之一 |
Optional properties
可选属性
Property | Description | Type | Default |
---|---|---|---|
squared | Squared flag | Boolean | true |
title | Title | String | null |
属性 | 描述 | 类型 | 默认 |
---|---|---|---|
平方 | 平方旗 | Boolean | true |
标题 | 标题 | String | null |
可用标志 (Available Flags)
Here follows the list of the currently available flags. They are identified using the ISO 639-1 standard.
以下是当前可用标志的列表。 它们使用ISO 639-1标准进行标识。
Language | Code |
---|---|
English | en |
Chinese | zh |
Hindi | hi |
Spanish | es |
Arabic | ar |
French | fr |
Malay | ms |
Russian | ru |
Bengali | bn |
Portuguese | pt |
German | de |
Japanese | ja |
Persian | fa |
Swahili | sw |
Javanese | jv |
Telugu | te |
Turkish | tr |
Korean | ko |
Marathi | mr |
Tamil | ta |
Vietnamese | vi |
Italian | it |
Hausa | ha |
Thai | th |
语言 | 码 |
---|---|
英语 | 恩 |
中文 | zh |
印地语 | 你好 |
西班牙文 | es |
阿拉伯 | AR |
法文 | fr |
马来语 | 多发性硬化症 |
俄语 | RU |
孟加拉 | n |
葡萄牙语 | pt |
德语 | 德 |
日本 | ja |
波斯语 | F A |
斯瓦希里语 | SW |
Java语 | 合资公司 |
泰卢固语 | te |
土耳其 | tr |
韩语 | KO |
马拉地语 | 先生 |
泰米尔语 | TA |
越南文 | 六 |
义大利文 | 它 |
豪萨 | 哈 |
泰国 | 日 |
翻译自: https://vuejsexamples.com/vue-component-which-shows-the-flag-of-the-country/