npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue3-currency-picker

v0.2.3

Published

Currency picker component for Vue 3

Downloads

40

Readme

vue3-currency-picker

vue3-currency-picker 是一个用于选择货币的下拉组件,使用 Vue 3 + Naive-UI 构建。

安装

npm install vue3-currency-picker
# or
yarn add vue3-currency-picker

使用

你可以全局注册组件或者局部引入它。

全局注册:

import CurrencyPicker from 'vue3-currency-picker';
import 'vue3-currency-picker/dist/style.css'; // 导入样式

Vue.use(CurrencyPicker);

局部引入:

<script setup>
import { CurrencyPicker } from 'vue3-currency-picker';
import 'vue3-currency-picker/dist/style.css'; // 导入样式

const form = reactive({
  currency: 'CNY'
})
</script>

<template>
  <currency-picker v-model:value="form.currency" />
</template>

Props

组件使用了 Naive-UI,大部分 NPickerNTag 的 props 都是支持的。

.

此外,组件本身的props如下:

| Prop Name | Type | Default | Description | | :------------- | --------------------------------------------------- | ------------- | ------------------------------------ | | value | Array<string \| number> \| string \| number \| null | undefined | 选择器的绑定值,可以使用 v-model | | justTag | Boolean | false | 使用标签模式 | | options | Array | currencyList | 自定义选项,点此查看 | | nameField | String | 'name' | 名称字段 | | flagField | String | 'flag' | 旗帜字段 | | multiple | Boolean | false | 是否多选 | | labelShowName | Boolean | true | 是否在标签上显示币种名称 | | optionShowName | Boolean | true | 是否在选项上显示币种名称 | | primaryColor | String | '#2E65FF' | 主题颜色,只支持16进制 |

支持的币种

当前版本含有的币种(当然,你可以自定义币种选项):

| Currency Code | Country/Organization | | ------------- | -------------------- | | AUD | Australia | | CAD | Canada | | CHF | Switzerland | | GBP | United Kingdom | | HKD | Hong Kong | | JPY | Japan | | NZD | New Zealand | | SEK | Sweden | | SGD | Singapore | | THB | Thailand | | USD | United States | | EUR | European Union | | MYR | Malaysia | | KRW | South Korea | | CNY | China | | RUB | Russia | | DKK | Denmark | | AED | United Arab Emirates | | NOK | Norway | | PLN | Poland | | VND | Vietnam | | HUF | Hungary | | KZT | Kazakhstan | | MXN | Mexico | | SAR | Saudi Arabia | | INR | India | | PHP | Philippines | | MNT | Mongolia | | KHR | Cambodia |

自定义 options

你可以导入组件里的 currencyList 进行一些修改:

import { currencyList } from 'vue3-currency-picker'

或者自定义,例如:

[
  {
    currency: 'AUD',
    flag: ()=> h(Icon),
    name: '澳元',
  },
]

Packages

The main npm packages used in this project are the following:

  • vue.js v3
  • naive-ui

License

MIT © 2020 Ag Liu