mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
42 lines
1.0 KiB
HTML
42 lines
1.0 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<html lang="zh-cn">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>08 PathTest</title>
|
|
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
|
|
</head>
|
|
|
|
<body>
|
|
<script src="../dist/ShadowEditor.SVG.js"></script>
|
|
<script>
|
|
var dom = Shadow.SVG.create({
|
|
xtype: 'svg',
|
|
parent: document.body,
|
|
attr: {
|
|
width: 400,
|
|
height: 400,
|
|
viewBox: '0 0 400 400'
|
|
},
|
|
children: [{
|
|
xtype: 'path',
|
|
attr: {
|
|
d: 'M 100 100 L 300 100 L 200 300 z',
|
|
stroke: 'blank',
|
|
'stroke-width': 3,
|
|
fill: 'orange'
|
|
},
|
|
listeners: {
|
|
click: () => {
|
|
alert('You clicked!');
|
|
}
|
|
}
|
|
}]
|
|
});
|
|
|
|
dom.render();
|
|
</script>
|
|
</body>
|
|
|
|
</html> |