Urgent.News

What's breaking now, across thousands of outlets.

Tech

How to add country icons to a Vue 3 app

Vue has no shortage of icon sets. Carets and chevrons come in every pack. Geography is the thin part of the shelf: where a set covers countries at all, it usually means flag squares rather than map shapes . GeoIcons ships country, area, and subdivision icons as individual Vue 3 components, 799 of them at the time of writing. Adding one takes three steps: install the package, import the icon by…

Adding country icons to a Vue 3 app is a straightforward process. First, you must install the @geoicons/vue package using npm. Once installed, you can import individual country icons as Vue 3 components by using their full PascalCase names like UnitedStates, France, or Japan. The icons are rendered like any other Vue component, with the optional size and strokeWidth props used to adjust their dimensions and outline thickness, respectively.

Default styling applies, and you can customize colors and other attributes through attribute fallthrough. For icons representing countries at runtime, create a small component map using the component :is directive to keep the bundle tree-shakable. ARIA labels should be provided only when the icon conveys the country information, as the icons themselves are decorative and receive aria-hidden by default.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The shell step that could not fail no matter what we did to it

Our integration suite had been green for eleven weeks. That is not a boast, it is the symptom. A colleague onboarding to the repo wrote a deliberately broken test to see what a failure looked like…

  • Shell step npm run test:integration | tee integration.log || true contained two errors
  • set -o pipefail absent, causing pipeline exit status to always be zero
  • Fix: all scripts began with set -euo pipefail

Two Sources of Truth Will Always Disagree

Somewhere in your system the same fact is stored twice. A count in a column and the rows it is counting. A status on the order and a status on the payment.

  • Two sources of data for the same fact will inevitably diverge over time
  • Discrepancies can result from write failures, off-peak jobs, or partial migrations
  • Systems must identify the accurate source, as both are considered truth

More from Friday 11 September →