简体   繁体   English

如何将 Paper-radio-button 样式设置为普通单选按钮?

[英]How to style the Paper-radio-button to a normal radio button?

For paper-input there is an alternative to make it normal design.对于纸张输入,有一种替代方法可以使其正常设计。 That is iron input.那是铁输入。 Is there any alternative like that for radio button for making it as look like normal radio button?有没有类似单选按钮的替代方法,使它看起来像普通的单选按钮? If so kindly help me..如果是这样请帮助我..

Doesn't look possible.看起来不太可能。 The <paper-radio-button> is composed of <div> s (it doesn't wrap a native radio button) and only provides a limited set of CSS properties to customize colors and sizes. <paper-radio-button><div>组成(它不包装原生单选按钮)并且只提供一组有限的 CSS 属性来自定义颜色和大小。 The CSS properties don't allow disabling the Material Design. CSS 属性不允许禁用 Material Design。

Consider using the native radio button with iron-input instead:考虑使用带有iron-input的本机单选按钮:

<input type="radio" is="iron-input">

 HTMLImports.whenReady(() => { Polymer({ is: 'x-foo' }); });
 <head> <base href="https://polygit.org/polymer+1.7.1/components/"> <script src="webcomponentsjs/webcomponents-lite.min.js"></script> <link rel="import" href="polymer/polymer.html"> <link rel="import" href="iron-input/iron-input.html"> </head> <body> <x-foo></x-foo> <dom-module id="x-foo"> <template> <label> <input type="radio" is="iron-input"> option 1 </label> </template> </dom-module> </body>

codepen代码笔

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM