在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):GoogleWebComponents/google-chart开源软件地址(OpenSource Url):https://github.com/GoogleWebComponents/google-chart开源编程语言(OpenSource Language):TypeScript 97.7%开源软件介绍(OpenSource Introduction):google-chartGoogle Charts API web components. See: Documentation UsageInstallationnpm i @google-web-components/google-chart In HTML file<html>
<head>
<script type="module">
import '@google-web-components/google-chart';
</script>
</head>
<body>
<google-chart data='[["Month", "Days"], ["Jan", 31]]'></google-chart>
</body>
</html> In a LitElementimport {LitElement, html} from 'lit';
import {customElement} from 'lit/decorators.js';
import '@google-web-components/google-chart';
@customElement('new-element')
export class NewElement extends LitElement {
render() {
return html`
<google-chart data='[["Month", "Days"], ["Jan", 31]]'></google-chart>
`;
}
} In a Polymer 3 elementimport {PolymerElement, html} from '@polymer/polymer';
import '@google-web-components/google-chart';
class NewElement extends PolymerElement {
static get template() {
return html`
<google-chart data='[["Month", "Days"], ["Jan", 31]]'></google-chart>
`;
}
}
customElements.define('new-element', NewElement); More usage examplesSee examples in the demo or try this live JS bin. Uprading from 3.xThe component has been migrated to LitElement and uses TypeScript now. This migration introduced two breaking changes.
Removed Polymer-specific |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论