vue-fontawesome icon indicating copy to clipboard operation
vue-fontawesome copied to clipboard

How to use unicode with vue-fontawesome?

Open apmyp1990 opened this issue 2 years ago • 1 comments

We are migrating a php web app to vue. In the app we are using the unicodes of the icons - store in the db. To use font-awesome perfectly with vue, we followed the guide in the docs to set it up, but unfortunately there is nothing mentioned about the usage of unicodes with vue.

I tried some variations, but it is not working - telling me the icon could not be found.

Is there a way to use the present unicodes with vue? Or, if not, is there a possibility to get the icon names by unicode?

Thanks in advance!

apmyp1990 avatar Aug 17 '22 14:08 apmyp1990

There is currently not a way to use unicode values within our Vue components... that would be an interesting enhancement though.

The way to get the unicode values with the icon names is with our GraphQL API

Here is the query I created to get the unicode values and the icon name (icon name being the id):

{
  release(version: "6.x") {
      pro
      free
    }
    icons{
      id
      unicode
    }
  }
}

example output:

{
  "data": {
    "release": {
      "iconCount": {
        "free": 2016,
        "pro": 17271
      },
      "icons": [
        {
          "id": "0",
          "unicode": "30"
        },
        {
          "id": "00",
          "unicode": "e467"
        },
        ...
        {
          "id": "less-than-equal",
          "unicode": "f537"
        },
        {
          "id": "life-ring",
          "unicode": "f1cd"
        },
        ...

jasonlundien avatar Sep 06 '22 13:09 jasonlundien

Thanks for the answer. There are only 4 icons stored in db which we are using, so I just added a new column and stored the names too.

apmyp1990 avatar Oct 07 '22 06:10 apmyp1990

@apmyp1990 --

I am going to go ahead and close this issue. If you feel as if there needs to be additional discussion or an issue just let us know.

jasonlundien avatar Nov 01 '22 13:11 jasonlundien