Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way for replace the "Dowload" text with custom icon? #4

Open
Howard0401 opened this issue Jun 23, 2021 · 2 comments
Open

Comments

@Howard0401
Copy link

Umm... I would like to use a "custom" icon for download link, but didn't find an efficient solution.

import QRCode from 'vue3-qr-code-styling'

<QRCode 
ButtonName="proper length as my logo"
>
</QRCode>

I tried

  1. turn the class my-button font color to be same as background color.
  2. use background-image as my custom image.
.my-button {
  background-image: url('../assets/logo.png'); <- this is my icon
  background-repeat: no-repeat;
  margin-top:1rem !important; 
  margin-left:1rem !important; 
  background-size: 20px 20px;
  font-size: 20px;
  color:white;
}

It seems to work, but it shouldn't be the correct solution, maybe there is better way?

BTW, any possible for support tailwind css in myclass and downloadButton ?

@diadal
Copy link
Owner

diadal commented Jun 23, 2021

check this downloadButton is for button class so you can :downloadButton="my-button"

<div v-if="imageUrl" :class="myclass">
      <img :src="imageUrl" :class="imgclass" />
    </div>
    <div v-if="download">
      <button @click="onDownloadClick" :class="downloadButton">
        {{ ButtonName }}
      </button>
      <br />
      <br />
    </div>
  </div>

@Howard0401
Copy link
Author

Howard0401 commented Jun 24, 2021

Thanks for your speedy reply!
And there is no image attribute binding option like below?

 <img :src="buttonOption" /> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants