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.
31 lines
648 B
31 lines
648 B
import {
|
|
invoke,
|
|
requireNativePlugin
|
|
} from '../../bridge'
|
|
|
|
export function getClipboardData (options, callbackId) {
|
|
const clipboard = requireNativePlugin('clipboard')
|
|
clipboard.getString(ret => {
|
|
if (ret.result === 'success') {
|
|
invoke(callbackId, {
|
|
data: ret.data,
|
|
errMsg: 'getClipboardData:ok'
|
|
})
|
|
} else {
|
|
invoke(callbackId, {
|
|
data: ret.result,
|
|
errMsg: 'getClipboardData:fail'
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
export function setClipboardData ({
|
|
data
|
|
}) {
|
|
const clipboard = requireNativePlugin('clipboard')
|
|
clipboard.setString(data)
|
|
return {
|
|
errMsg: 'setClipboardData:ok'
|
|
}
|
|
}
|
|
|