Mar*_*kob 10 dart polymer dart-polymer
我正在尝试在自定义聚合物元素上拖放HTML5,但它不起作用.没有聚合物,可以只添加draggable
属性.
这是我在Dart中的代码:
<polymer-element name="my-component">
<template>
<style>
@host {
:scope {
display: block;
}
}
div {
background-color: red;
width: 200px;
height: 200px;
}
</style>
<div>
Drag me
</div>
</template>
<script type="application/dart" src="my_component.dart"></script>
</polymer-element>
Run Code Online (Sandbox Code Playgroud)
import 'package:polymer/polymer.dart';
@CustomTag('my-component')
class MyComponent extends PolymerElement {
MyComponent.created() : super.created();
}
Run Code Online (Sandbox Code Playgroud)
<!DOCTYPE html>
<html>
<head>
<link rel="import" href="my_component.html">
<script type="application/dart">import 'package:polymer/init.dart';</script>
<script src="packages/browser/dart.js"></script>
</head>
<body>
<my-component draggable="true"></my-component>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我也尝试直接从HTML元素扩展.这也不起作用.
有关聚合物元素如何可拖动的任何想法?
编辑:有一个错误报告.
归档时间: |
|
查看次数: |
8076 次 |
最近记录: |