Why: the goal or problem
Readers save books and articles on a shelf. Labels and counts must agree; its team prefers reactive HTML-like templates over manual edits.
How: work toward a solution
Two cards in a reading shelf start unsaved. Save on Library Book changes only its label to Saved; Garden Article stays unsaved. Saving Garden Article changes the shared count from one to two. Repeating Save leaves two records: each card counts once. The diagram connects reactive state to the template. Reset or reload clears both cards. Nothing is persisted.
Concept simulation
Vue
Save either card. Each card counts once; the other card stays unchanged.
01 · Logic: reactive state
Library Book: 0 · Garden Article: 0
02 · Template: state bindings
Library Book
Reading shelf
Garden Article
Reading shelf
03 · Style: card presentation
One authoring file; packaging is separate.
Saved count: 0 / 2
Waiting
- Execution boundary
- Browser model: card state and shared records update templates after each click.
- State and responsibility
- One record set owns the count. Reload clears it; real persistence needs a service. Vue itself is not loaded here.
A fictional demo within this article. Reset or reload restores its initial state.
What: the concept
Vue binds templates to reactive state. A single-file component can colocate logic, template, and styles; it is an authoring format, not a network-file guarantee.
Define shared ownership and external persistence separately.
Discuss this idea
Comments are shared across languages. GitHub login required to post.