941477276 / vue3-country-intl

基于vue3的国际化的国籍/手机区号组件!
30 stars 3 forks source link

国旗Icon不对 #13

Closed ooooshino closed 5 months ago

ooooshino commented 5 months ago

安装、注册组件,都是按照这个文档走的vue3-country-intl

虽然正确展示了,控制台也没报错,但是看到国旗和国家不对应

连续搜了几个,国旗都是错乱的

f04e8da4e99cb9d63b2a12968ff5b1ed.png

d4662b61e32a5962caf73b33b06fc5ba.png

各版本如下:

{
    "vue": "^3.3.4",
    "vue3-country-intl": "^2.0.3",
    "vite": "^4.4.5"
}
{
    "macos": "13.5 (22G74)",
    "vscode": "Version: 1.88.1"
}

导入注册main.js:

import VueCountryIntl from 'vue3-country-intl';
import 'vue3-country-intl/lib/vue3-country-intl.css'

createApp(App)
  .component(VueCountryIntl.name, VueCountryIntl)
  .mount('#app')

使用代码是文档里的popover模式

 <Vue3CountryIntl
              schema="popover"
              elId="my_reference"
              v-model="schemaPopoverData.default"
              v-model:visible="schemaPopoverData.visible"
            >
              <button type="button" @click="schemaPopoverData.visible = true">
                选择手机区号
              </button>
</Vue3CountryIntl>
941477276 commented 5 months ago

可以贴下代码吗?demo里面的都是正确的呀

ooooshino commented 5 months ago

可以贴下代码吗?demo里面的都是正确的呀

更新Issues了,你看一下还需要什么

941477276 commented 5 months ago

我用你的示例代码跑了一下,没有出现你说的问题呀 image image image

运行结果 image image

能否远程看下?地址栏有我QQ号

hsk-story commented 5 months ago

@941477276 这个似乎和浏览器版本有关系,我这边也遇到了,可以把国旗展示作为配置项隐藏掉吗

941477276 commented 5 months ago

@941477276 这个似乎和浏览器版本有关系,我这边也遇到了,可以把国旗展示作为配置项隐藏掉吗

image showLabelImg设置为false即可,你用的是什么浏览器?哪个版本?

hsk-story commented 5 months ago

找到问题了, 因为装了postcss-px-to-viewport, 插件直接将所有的px都转成vw了, 导致iti-flag类下的background-position偏移量计算有问题. 直接把iti-flag类名加到postcss-px-to-viewport的selectorBlackList黑名单配置上就能解决