在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):PolymerElements/paper-toast开源软件地址(OpenSource Url):https://github.com/PolymerElements/paper-toast开源编程语言(OpenSource Language):HTML 51.4%开源软件介绍(OpenSource Introduction):<paper-toast>
Use Example: <paper-toast text="Hello world!" opened></paper-toast> Also Example: <paper-button on-click="openToast">Open Toast</paper-button>
<paper-toast id="toast" text="Hello world!"></paper-toast>
...
openToast: function() {
this.$.toast.open();
} Set Example: <paper-toast text="Terms and conditions" opened duration="0">
<a href="#">Show more</a>
</paper-toast>
<!-- ... -->
</app-drawer-layout>
<paper-toast id="toast"></paper-toast>
</template> You can then use custom events to communicate with it from within child components, using StylingThe following custom properties and mixins are available for styling:
This element applies the mixin See: Documentation, Demo. UsageInstallation
In an html file<html>
<head>
<script type="module">
import '@polymer/paper-toast/paper-toast.js';
</script>
</head>
<body>
<paper-toast text="Hello world!" opened></paper-toast>
</body>
</html> In a Polymer 3 elementimport {PolymerElement, html} from '@polymer/polymer';
import '@polymer/paper-toast/paper-toast.js';
class SampleElement extends PolymerElement {
static get template() {
return html`
<paper-toast text="Hello world!" opened></paper-toast>
`;
}
}
customElements.define('sample-element', SampleElement); ContributingIf you want to send a PR to this element, here are the instructions for running the tests and demo locally: Installationgit clone https://github.com/PolymerElements/paper-toast
cd paper-toast
npm install
npm install -g polymer-cli Running the demo locallypolymer serve --npm
open http://127.0.0.1:<port>/demo/ Running the testspolymer test --npm |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论