Comments (2)
This doesn't contain a reproducible example so I can't tell for sure. At a glance: edit_url
is reactive (it is a memo, so will react to changes in both novel_name
and chapter_title
), {format!(...)}
is not reactive, so that could be one cause of the issue. Otherwise, not sure. If you can provide a reproducible example I'm happy to take a look.
from leptos.
这不包含可重复的示例,所以我无法确定。一目了然:是被动的(它是备忘录,所以会对两者的变化做出反应),不是被动的,所以这可能是问题的原因之一。否则,不确定。如果你能提供一个可重复的例子,我很乐意看一看。
edit_url``novel_name``chapter_title``{format!(...)}
Thank you. I already know what the problem is, okay
this is a reproducible example, Ineed to use closures like href={move || format!("view/{}/{}", param_a(), param_b())}
use leptos::*;
use leptos_meta::*;
use leptos_router::*;
#[component]
pub fn App() -> impl IntoView {
// Provides context that manages stylesheets, titles, meta tags, etc.
provide_meta_context();
view! {
// injects a stylesheet into the document <head>
// id=leptos means cargo-leptos will hot-reload this stylesheet
<Stylesheet id="leptos" href="/pkg/tests-tag-a.css"/>
// sets the document title
<Title text="Welcome to Leptos"/>
// content for this welcome page
<Router>
<main>
<Routes>
<Route path="" view=ChangePramsB/>
</Routes>
</main>
</Router>
}
}
/// Renders the home page of your application.
#[component]
pub fn PageOne(param_a: ReadSignal<String>, param_b: ReadSignal<String>) -> impl IntoView {
// Creates a reactive value to update the button
let url = create_memo(move |_| format!("view/{}/{}", param_a(), param_b()));
view! {
<a href={format!("view/{}/{}", param_a(), param_b())}> test1 </a>
<a href={url}> test2 </a>
}
}
#[component]
fn ChangePramsB() -> impl IntoView {
let (param_a, set_param_a) = create_signal(String::from("aa"));
let (param_b, set_param_b) = create_signal(String::from(""));
view! {
<button on:click={move |_| set_param_b("bbb".to_string())}> "change param b" </button>
<PageOne param_a=param_a param_b=param_b />
}
}
from leptos.
Related Issues (20)
- Allow custom derive for server_fns with custom encoding HOT 3
- Add Trigger::dispose
- leptos_macro 0.6.11 leptos::view! breaks with some comments
- Non-'static signals
- Effects/Memos should't be able to "own" a signal HOT 4
- Nested Suspense ignores SSR Mode and breaks Hydration HOT 2
- Error when running server function inside spawn_local HOT 5
- Click events are registered twice when two leptos custom elements are on a page HOT 3
- about mobile support
- Recursive effects never run after recursing HOT 4
- Clippy warnings in some components with rust 1.78 HOT 1
- rkyv, avoid the copy to byte ? HOT 4
- Check ActionForm input names at compile time HOT 4
- Allow server components in islands architecture to call code behind ssr without need for #[server] HOT 1
- porting over some react code to my project, having hydration issues
- leptos_router parent Route attr view is not generating view for dynamic routes HOT 4
- relese build causes SIGSEGV and SIGBUS while dev build is just fine HOT 3
- `HtmlElement::attrs` and `DynAttrs::dyn_attrs` Accept `&'static str` Instead of `Oco<'static, str>` HOT 2
- Notify crate (lib) not compiling when installing cargo-leptos HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leptos.