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
252 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
}
declare readonly copyValue: string;
async copy(){
await navigator.clipboard.writeText(this.copyValue)
}
}