Vue组件,显示国家的国旗

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

强制性

PropertyDescriptionTypeValue
isoISO 639-1 identifier of the languageStringone of the values defined here
属性 描述 类型
iso ISO 639-1语言标识符 String 此处定义的值之一

Optional properties

可选属性

PropertyDescriptionTypeDefault
squaredSquared flagBooleantrue
titleTitleStringnull
属性 描述 类型 默认
平方 平方旗 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标准进行标识。

LanguageCode
Englishen
Chinesezh
Hindihi
Spanishes
Arabicar
Frenchfr
Malayms
Russianru
Bengalibn
Portuguesept
Germande
Japaneseja
Persianfa
Swahilisw
Javanesejv
Telugute
Turkishtr
Koreanko
Marathimr
Tamilta
Vietnamesevi
Italianit
Hausaha
Thaith
语言
英语
中文 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/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值