GithubHelp home page GithubHelp logo

Comments (6)

chenjiahan avatar chenjiahan commented on May 18, 2024 1

We can add new show-confirm-button and show-cancel-button props and keep confirm-button-text as string type

from vant.

chenjiahan avatar chenjiahan commented on May 18, 2024 1

Yes, this is also a feasible solution, and I remain open to it.

from vant.

mahnunchik avatar mahnunchik commented on May 18, 2024

Current solution is to override confirm slot but it is requires more code.

from vant.

mahnunchik avatar mahnunchik commented on May 18, 2024

const text = props.confirmButtonText || t('confirm');
return (
<button
type="button"
class={[bem('confirm'), HAPTICS_FEEDBACK]}
onClick={onConfirm}
>
{slots.confirm ? slots.confirm() : text}
</button>

from vant.

github-actions avatar github-actions commented on May 18, 2024

Hello @mahnunchik. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please send your Pull Request to main branch, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!

你好 @mahnunchik,我们完全同意你的提议/反馈,欢迎直接在此仓库 创建一个 Pull Request 来解决这个问题。请将 Pull Request 发到 main 分支,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待你的贡献。

from vant.

mahnunchik avatar mahnunchik commented on May 18, 2024

@chenjiahan Yes, it is one of possible solutions.

But my point of view, that show-* props for all *-text texts may encrise amount of props almost twice.

Another option is to fix handling empty strings here

const text = props.confirmButtonText || t('confirm');
to be able to render empty sting by :confirm-button-text="" as expected.

I mean something like the following:

const text = props.confirmButtonText !== undefined ?  props.confirmButtonText : t('confirm');

from vant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.