Retrospring/app/javascript/retrospring/controllers/clipboard_controller.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
254 B
TypeScript
Raw Normal View History

2023-11-12 03:03:59 -08:00
import { Controller } from "@hotwired/stimulus";
export default class extends Controller {
static values = {
copy: String
2023-11-12 03:17:33 -08:00
};
2023-11-12 03:03:59 -08:00
declare readonly copyValue: string;
async copy(){
2023-11-12 03:17:33 -08:00
await navigator.clipboard.writeText(this.copyValue);
2023-11-12 03:03:59 -08:00
}
}