【问题标题】:Is there a way in svelte where I can put the calendar icon inside input field? And, how can I change the color of the calendar?有没有一种方法可以将日历图标放在输入字段中?而且,如何更改日历的颜色?
【发布时间】:2020-09-10 03:23:25
【问题描述】:

这是我的代码: https://svelte.dev/repl/f137b909d3e740f99a030576189091db?version=3.22.3 如何在输入字段中添加日历图标?还有,如何更改日历的颜色?

提前致谢!

【问题讨论】:

    标签: javascript web web-applications desktop svelte


    【解决方案1】:

    您使用 3rd 方组件,快速查看他们的文档告诉我,它不支持图标的自定义放置。

    https://svelte-mui.now.sh/datepicker/datefield

    更改颜色有点棘手。他们使用全局 css 变量,我会这样做。将以下 sn-p 添加到您的 App.svelte:

    <style>
        :global(:root) {
            --primary: red;
        }
    </style>
    

    还有更多可以覆盖的全局变量。看看他们的例子:

    https://github.com/vikignt/svelte-mui/blob/master/example/assets/global.css

    【讨论】:

      猜你喜欢
      • 2020-09-21
      • 2017-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多