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

[NEW FEATURE] Changed rendering mode for text item in picker. #233

Merged
merged 1 commit into from
Jun 19, 2018

Conversation

NikolaLohinski
Copy link
Contributor

Hi there,

Thanks for this awesome UI components library, it is very handy and easy to use.

However, I need to be able to put custom icons/images as elements in the picker (I am building a card game where you may select the type of card, for example spades or hearths). Since there is only text rendering in the picker, I made in this PR the simplest changes to be able to handle dynamic HTML string templates rather than just text, which would solve my issue. See below for the details.

Changed the text rendering mode in the picker component,
From:

  • Using innerText rendering with <li>{{...}}</li>
    To:
  • Using innerHTML rendering with <li v-html="..."></li>

This does not change anything for text items, but allows to insert HTML templates, especially icons and all the tests seem to be ok.

Thanks for your consideration,

Cheers,

NikolaLohinski

Changed the text rendering mode in the picker component,
From:
using innerText rendering with <li>{{...}}</li>
To:
using innerHTML rendering with <li v-html="..."></li>

This does not change anything for text items, but allows to insert HTML templates, especially icons.

All the tests seem to be ok.
@codecov-io
Copy link

Codecov Report

Merging #233 into dev will decrease coverage by 0.08%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #233      +/-   ##
==========================================
- Coverage   92.42%   92.34%   -0.09%     
==========================================
  Files         114      114              
  Lines        2390     2390              
  Branches      351      351              
==========================================
- Hits         2209     2207       -2     
- Misses         96       97       +1     
- Partials       85       86       +1
Impacted Files Coverage Δ
src/components/picker/picker.vue 81.03% <ø> (ø) ⬆️
src/components/slide/slide.vue 83.51% <0%> (-2.2%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9724c36...20e03c8. Read the comment docs.

@dolymood dolymood requested a review from AmyFoxFN June 16, 2018 15:35
@AmyFoxFN AmyFoxFN merged commit d199c32 into didi:dev Jun 19, 2018
@AmyFoxFN
Copy link
Contributor

AmyFoxFN commented Jun 19, 2018

Thanks for your PR.
It's very happy to hear that cube is handy for you. we are a little afraid that our poor english doc will be hard to read. Thanks again, and really looks forward to your next PR~~ 😄

@AmyFoxFN
Copy link
Contributor

@NikolaLohinski the feature has already published in cube-ui@1.9.9~

@NikolaLohinski
Copy link
Contributor Author

Thank you very much, this really enables the picker to be more suitable for custom icons and helps me with my app :-)
When I have some left time I ll be glad to see if I can give you guys a hand, with the english why not haha
Cheers

hu0950 pushed a commit that referenced this pull request Nov 1, 2019
Changed the text rendering mode in the picker component,
From:
using innerText rendering with <li>{{...}}</li>
To:
using innerHTML rendering with <li v-html="..."></li>

This does not change anything for text items, but allows to insert HTML templates, especially icons.

All the tests seem to be ok.
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

Successfully merging this pull request may close these issues.

3 participants