mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-03-13 09:09:48 -04:00
parent
ffd4f0a6fe
commit
17cfb8a23b
3 changed files with 7 additions and 2 deletions
1
.idea/leptos-use.iml
generated
1
.idea/leptos-use.iml
generated
|
@ -77,6 +77,7 @@
|
||||||
<sourceFolder url="file://$MODULE_DIR$/examples/use_or/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/examples/use_or/src" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/examples/use_event_source/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/examples/use_event_source/src" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/examples/sync_signal/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/examples/sync_signal/src" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/examples/use_user_media/src" isTestSource="false" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/examples/use_event_listener/target" />
|
<excludeFolder url="file://$MODULE_DIR$/examples/use_event_listener/target" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/docs/book/book" />
|
<excludeFolder url="file://$MODULE_DIR$/docs/book/book" />
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
use leptos::*;
|
use leptos::*;
|
||||||
use leptos_use::docs::{demo_or_body, Note};
|
use leptos_use::docs::{demo_or_body, Note};
|
||||||
use leptos_use::{use_clipboard, use_permission, UseClipboardReturn};
|
use leptos_use::{
|
||||||
|
use_clipboard_with_options, use_permission, UseClipboardOptions, UseClipboardReturn,
|
||||||
|
};
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
fn Demo() -> impl IntoView {
|
fn Demo() -> impl IntoView {
|
||||||
|
@ -11,7 +13,7 @@ fn Demo() -> impl IntoView {
|
||||||
text,
|
text,
|
||||||
copied,
|
copied,
|
||||||
copy,
|
copy,
|
||||||
} = use_clipboard();
|
} = use_clipboard_with_options(UseClipboardOptions::default().read(true));
|
||||||
|
|
||||||
let permission_read = use_permission("clipboard-read");
|
let permission_read = use_permission("clipboard-read");
|
||||||
let permission_write = use_permission("clipboard-write");
|
let permission_write = use_permission("clipboard-write");
|
||||||
|
|
|
@ -127,6 +127,8 @@ pub fn use_clipboard_with_options(
|
||||||
pub struct UseClipboardOptions {
|
pub struct UseClipboardOptions {
|
||||||
/// When `true` event handlers are added so that the returned signal `text` is updated whenever the clipboard changes.
|
/// When `true` event handlers are added so that the returned signal `text` is updated whenever the clipboard changes.
|
||||||
/// Defaults to `false`.
|
/// Defaults to `false`.
|
||||||
|
///
|
||||||
|
/// > Please note that clipboard changes are only detected when copying or cutting text inside the same document.
|
||||||
read: bool,
|
read: bool,
|
||||||
|
|
||||||
/// After how many milliseconds after copying should the returned signal `copied` be set to `false`?
|
/// After how many milliseconds after copying should the returned signal `copied` be set to `false`?
|
||||||
|
|
Loading…
Add table
Reference in a new issue