forked from fanruan/fineui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1014 B
42 lines
1014 B
8 years ago
|
Demo.Func = BI.inherit(BI.Widget, {
|
||
|
props: {
|
||
|
baseCls: "demo-func"
|
||
|
},
|
||
|
|
||
|
render: function () {
|
||
|
var editor = BI.createWidget({
|
||
|
type: "bi.text_editor",
|
||
|
width: 200,
|
||
|
height: 30,
|
||
|
value: "这是复制的内容"
|
||
|
});
|
||
8 years ago
|
var clipboard = BI.createWidget({
|
||
|
type: 'bi.clipboard',
|
||
8 years ago
|
width: 100,
|
||
|
height: 100,
|
||
|
cls: 'layout-bg1',
|
||
8 years ago
|
text: function () {
|
||
8 years ago
|
return editor.getValue();
|
||
|
},
|
||
|
|
||
|
afterCopy: function () {
|
||
|
BI.Msg.toast(editor.getValue());
|
||
|
}
|
||
|
});
|
||
|
|
||
|
BI.createWidget({
|
||
|
type: "bi.absolute",
|
||
|
element: this,
|
||
|
items: [{
|
||
|
el: editor,
|
||
|
left: 100,
|
||
|
top: 50,
|
||
|
}, {
|
||
8 years ago
|
el: clipboard,
|
||
8 years ago
|
left: 100,
|
||
|
top: 100
|
||
|
}]
|
||
|
})
|
||
|
}
|
||
|
});
|
||
8 years ago
|
BI.shortcut("demo.clipboard", Demo.Func);
|