Vue.js course · Module 3: Reactivity
Reactivity in Practice - Control Panel
In this lesson5
Let's combine everything in practical NOVA LAB system examples.
So far you have looked at each reactivity tool on its own. Real station panels combine them all at once: the configuration form has to validate data on the fly, the module monitor filters the list by the typed phrase, and the supply system adds up the order totals. All three panels below share the same layering. First the data in ref() or reactive(), then values derived with computed(), next the actions, meaning the functions that change the state, and finally the template with reactive bindings.
Reactor Configuration Panel with Validation
The form template uses v-model, the two-way binding between a field and the data, which you will learn in detail in module 5. The .number modifier turns the typed text into a number, and you know @submit.prevent and :disabled from module 2:
<template>
<form @submit.prevent="submitConfig" class="reactor-config" style="background: #0a0e27; color: #00ff88;">
<div>
<label>Module name:</label>
<input v-model="config.name" style="background: #1a1e37; color: #00ff88;" />
<span v-if="errors.name" style="color: #ff4444;">{{ errors.name }}</span>
</div>
<div>
<label>Maximum temperature (K):</label>
<input v-model.number="config.maxTemp" type="number" style="background: #1a1e37; color: #00ff88;" />
<span v-if="errors.maxTemp" style="color: #ff4444;">{{ errors.maxTemp }}</span>
</div>
<div>
<label>Status:</label>
<input v-model="config.status" style="background: #1a1e37; color: #00ff88;" />
</div>
<button :disabled="!isValid" style="background: #00b4d8; color: #0a0e27;">Save configuration</button>
</form>
</template>Error messages appear through v-if only when there is something to show, and the save button stays disabled until the form is valid. The form data is a coherent group of fields, so we keep it in reactive():
<script setup>
import { reactive, computed } from 'vue'
const config = reactive({
name: '',
maxTemp: null,
status: ''
})Validation is a value derived from these fields. In the first version of this panel, the computed property itself wrote the messages into a separate errors object. The Vue docs forbid side effects in computed properties, though: a getter should only compute and return a result. That is why the errors themselves are computed here:
// Validation as a derived value - no side effects
const errors = computed(() => ({
// Name validation
name: config.name.length < 3 ? 'Name must be at least 3 characters' : '',
// Temperature validation
maxTemp: config.maxTemp && (config.maxTemp < 1000 || config.maxTemp > 10000)
? 'Temperature must be between 1000 and 10000 K'
: ''
}))
const isValid = computed(() => !errors.value.name && !errors.value.maxTemp)The template needed no change: errors is a top-level ref, so errors.name works in it without .value. Typing the third character of the name recalculates both computed properties and enables the button. The action that sends the configuration only reads the finished result:
function submitConfig() {
if (isValid.value) {
console.log('Sending configuration to NOVA LAB:', config)
}
}
</script>Module Monitoring System
The monitor combines a search field and a drop-down list with a filtered list of modules. v-model works on <select> as well:
<template>
<div class="module-monitor" style="background: #0a0e27; color: #00ff88;">
<input v-model="searchQuery" placeholder="Search module..." style="background: #1a1e37; color: #00ff88;" />
<select v-model="filterStatus" style="background: #1a1e37; color: #00ff88;">
<option value="">All statuses</option>
<option value="ACTIVE">Active</option>
<option value="STANDBY">Standby</option>
</select>
<ul>
<li v-for="module in filteredModules" :key="module.id" style="border-bottom: 1px solid #00b4d8;">
{{ module.name }} - {{ module.status }}
</li>
</ul>
<p>Found: {{ filteredModules.length }} modules</p>
</div>
</template>The template filters nothing on its own - it receives the ready list filteredModules. The state is two simple refs and an array of modules:
<script setup>
import { ref, computed } from 'vue'
const searchQuery = ref('')
const filterStatus = ref('')
const modules = ref([
{ id: 1, name: 'Oxygen Generator Alpha', status: 'ACTIVE' },
{ id: 2, name: 'Plasma Core Beta', status: 'STANDBY' },
{ id: 3, name: 'Water Recycler Gamma', status: 'ACTIVE' },
{ id: 4, name: 'Power Distributor Delta', status: 'STANDBY' }
])The filter combines both conditions. The !filterStatus.value || part means: when no status is selected, let every module through:
const filteredModules = computed(() => {
return modules.value.filter(module => {
const matchesSearch = module.name
.toLowerCase()
.includes(searchQuery.value.toLowerCase())
const matchesStatus = !filterStatus.value ||
module.status === filterStatus.value
return matchesSearch && matchesStatus
})
})
</script>The original modules array stays untouched, and the list on screen refreshes with every typed character.
Mission Supply System
The supply order shows the number of items, the entries with a remove button and the total in credits:
<template>
<div class="supply-cart" style="background: #0a0e27; color: #00ff88;">
<h2>Order ({{ supplies.itemCount }} items)</h2>
<div v-for="item in supplies.items" :key="item.id" style="border-bottom: 1px solid #00b4d8;">
{{ item.name }} - {{ item.quantity }} x {{ item.price }} CR
<button @click="removeItem(item.id)" style="background: #ff4444; color: #fff;">Remove</button>
</div>
<p><strong>Total: {{ supplies.total }} CR (Credits)</strong></p>
</div>
</template>Here the derived values are written differently than in the previous panels: as getters inside the reactive object itself. A getter is a JavaScript property whose value is computed on every read by a function marked with the get keyword:
<script setup>
import { reactive } from 'vue'
const supplies = reactive({
items: [
{ id: 1, name: 'Oxygen Canister', quantity: 10, price: 50 },
{ id: 2, name: 'Plasma Cell', quantity: 5, price: 200 }
],
// Computed as property
get itemCount() {
return this.items.reduce((sum, item) => sum + item.quantity, 0)
},
get total() {
return this.items.reduce((sum, item) =>
sum + item.quantity * item.price, 0)
}
})At the start itemCount is 15 and total is 1500 CR. A getter computes its result on every read and, unlike computed(), does not cache it, which does not matter for a short list. The remove action changes the array in place:
function removeItem(id) {
const index = supplies.items.findIndex(item => item.id === id)
if (index > -1) {
supplies.items.splice(index, 1)
}
}
</script>After the plasma cells are removed, the total drops to 500 CR, because splice is a method Vue detects.
readonly() - A View Without Write Access
The monitor in the mess hall should show the reactor state, but it must not change it. readonly() returns a deep, read-only Proxy:
import { reactive, readonly } from 'vue'
const reactorState = reactive({ temperature: 2500 })
const reactorView = readonly(reactorState)
reactorView.temperature = 9999 // console warning, change rejected
reactorState.temperature = 2600 // a change through the original works
console.log(reactorView.temperature) // 2600In development mode an attempt to write ends with a Vue warning, and the value stays unchanged. The read-only view is not a copy: it shows every change of the original. The pattern is simple - you keep the writable state to yourself, share the readonly version with the outside, and make changes only through your own functions.
Choosing the Right Tool
The Vue docs recommend ref() as the primary tool. reactive() works well for coherent groups of fields, shallowRef() with triggerRef() for huge lists, markRaw() for instances from external libraries, and readonly() for sharing state. Under the hood Vue 3 intercepts access to objects with the native Proxy, and access to refs with getters and setters. Stick to the split into data, derived values, actions and template and every panel will stay readable. In the module project you will build a complete reactor monitoring system from these layers.
Remember: a good station panel has a single source of truth, derived values instead of manual copies, and actions that are the only thing allowed to touch the state.
Code for this lesson: App.vue
<script setup>
import { ref, reactive, markRaw, isReactive, toRaw } from 'vue'
// markRaw() - Plasma reactor control
// Advanced reactivity control in NOVA LAB
// Large object simulator (e.g. 3D library)
class HeavySimulationEngine {
constructor(name) {
this.name = name
this.iterations = 0
this.data = new Array(1000).fill(0).map((_, i) => ({
id: i,
value: Math.random() * 100
}))
}
simulate() {
this.iterations++
// Heavy computations
return this.data.reduce((sum, item) => sum + item.value, 0)
}
reset() {
this.iterations = 0
}
}
// Reactor with a normal object (reactive)
const reactiveReactor = reactive({
id: 'REACTOR-A',
status: 'ONLINE',
power: 100,
engine: new HeavySimulationEngine('Reactive Engine'),
lastUpdate: new Date().toISOString()
})
// Reactor with markRaw (non-reactive engine)
const optimizedReactor = reactive({
id: 'REACTOR-B',
status: 'ONLINE',
power: 100,
engine: markRaw(new HeavySimulationEngine('Optimized Engine')),
lastUpdate: new Date().toISOString()
})
// Reactivity check
const reactiveEngineIsReactive = isReactive(reactiveReactor.engine)
const optimizedEngineIsReactive = isReactive(optimizedReactor.engine)
// Counters for performance demonstration
const reactiveSimulationCount = ref(0)
const optimizedSimulationCount = ref(0)
function runReactiveSimulation() {
const start = performance.now()
// Modification of the reactive engine
reactiveReactor.engine.simulate()
reactiveReactor.lastUpdate = new Date().toISOString()
reactiveSimulationCount.value++
const end = performance.now()
console.log(`Reactive simulation: ${(end - start).toFixed(2)}ms`)
}
function runOptimizedSimulation() {
const start = performance.now()
// Modification of the markRaw engine
optimizedReactor.engine.simulate()
optimizedReactor.lastUpdate = new Date().toISOString()
optimizedSimulationCount.value++
const end = performance.now()
console.log(`Optimized simulation: ${(end - start).toFixed(2)}ms`)
}
// Practical example - map with many objects
const sensorNetwork = reactive({
location: 'Mars Base Alpha',
activeSensors: 0,
sensors: markRaw(new Map([
['TEMP-001', { type: 'temperature', value: 22 }],
['PRES-001', { type: 'pressure', value: 101 }],
['OXY-001', { type: 'oxygen', value: 21 }]
]))
})
function addSensor() {
const id = `SENS-${Date.now()}`
sensorNetwork.sensors.set(id, {
type: 'generic',
value: Math.random() * 100
})
// We update the reactive counter
sensorNetwork.activeSensors = sensorNetwork.sensors.size
}
function removeSensor() {
const keys = Array.from(sensorNetwork.sensors.keys())
if (keys.length > 0) {
sensorNetwork.sensors.delete(keys[keys.length - 1])
sensorNetwork.activeSensors = sensorNetwork.sensors.size
}
}
// toRaw() - access to the original object
function getRawReactor() {
const raw = toRaw(reactiveReactor)
console.log('Raw reactor (non-reactive):', raw)
console.log('Is reactive?', isReactive(raw)) // false
}
// Example with external library integration
const chartConfig = reactive({
title: 'Reactor Power Output',
// Large chart library - we don't need it reactive
chartInstance: markRaw({
render() {
return 'Chart rendered'
},
update(data) {
console.log('Chart updated with:', data)
},
destroy() {
console.log('Chart destroyed')
}
})
})
function updateChart() {
chartConfig.chartInstance.update({
power: reactiveReactor.power,
timestamp: new Date()
})
}
</script>
<template>
<div class="mark-raw-demo">
<div class="header">
<h1>REACTOR CONTROL - NOVA LAB</h1>
<p class="subtitle">markRaw() and toRaw() - Advanced reactivity control</p>
</div>
<!-- Performance comparison -->
<div class="comparison-section">
<h2>Performance comparison: Reactive vs markRaw</h2>
<div class="reactors-grid">
<!-- Reactor A - Reactive -->
<div class="reactor-card">
<div class="reactor-header">
<h3>{{ reactiveReactor.id }}</h3>
<span class="badge badge-reactive">REACTIVE</span>
</div>
<div class="reactor-stats">
<div class="stat">
<div class="label">Status</div>
<div class="value">{{ reactiveReactor.status }}</div>
</div>
<div class="stat">
<div class="label">Power</div>
<div class="value">{{ reactiveReactor.power }}%</div>
</div>
<div class="stat">
<div class="label">Engine iterations</div>
<div class="value">{{ reactiveReactor.engine.iterations }}</div>
</div>
<div class="stat">
<div class="label">Engine reactive?</div>
<div class="value">{{ reactiveEngineIsReactive ? 'YES' : 'NO' }}</div>
</div>
</div>
<div class="simulation-info">
<p>Simulations run: <strong>{{ reactiveSimulationCount }}</strong></p>
<p class="warning">Every change in the engine triggers reactivity!</p>
</div>
<button @click="runReactiveSimulation" class="btn btn-primary">
▶Run simulation
</button>
<div class="code-box">
<pre>// Normal object - reactive
const reactor = reactive({
engine: new Engine()
})
// engine and all its properties
// are reactive Slower!</pre>
</div>
</div>
<!-- Reactor B - Optimized -->
<div class="reactor-card">
<div class="reactor-header">
<h3>{{ optimizedReactor.id }}</h3>
<span class="badge badge-optimized">OPTIMIZED</span>
</div>
<div class="reactor-stats">
<div class="stat">
<div class="label">Status</div>
<div class="value">{{ optimizedReactor.status }}</div>
</div>
<div class="stat">
<div class="label">Power</div>
<div class="value">{{ optimizedReactor.power }}%</div>
</div>
<div class="stat">
<div class="label">Engine iterations</div>
<div class="value">{{ optimizedReactor.engine.iterations }}</div>
</div>
<div class="stat">
<div class="label">Engine reactive?</div>
<div class="value">{{ optimizedEngineIsReactive ? 'YES' : 'NO' }}</div>
</div>
</div>
<div class="simulation-info">
<p>Simulations run: <strong>{{ optimizedSimulationCount }}</strong></p>
<p class="success">The engine is not reactive - more efficient!</p>
</div>
<button @click="runOptimizedSimulation" class="btn btn-success">
Run simulation (faster)
</button>
<div class="code-box">
<pre>// markRaw - not reactive
const reactor = reactive({
engine: markRaw(new Engine())
})
// engine is NOT reactive
// Faster!</pre>
</div>
</div>
</div>
</div>
<!-- Sensor network -->
<div class="sensors-section">
<h2>Sensor network (practical markRaw example)</h2>
<div class="sensors-card">
<div class="sensors-header">
<h3>{{ sensorNetwork.location }}</h3>
<div class="sensor-count">
Active sensors: <strong>{{ sensorNetwork.activeSensors }}</strong>
</div>
</div>
<div class="sensors-grid">
<div
v-for="[id, sensor] in sensorNetwork.sensors"
:key="id"
class="sensor-item"
>
<div class="sensor-id">{{ id }}</div>
<div class="sensor-type">{{ sensor.type }}</div>
<div class="sensor-value">{{ sensor.value.toFixed(2) }}</div>
</div>
</div>
<div class="controls">
<button @click="addSensor" class="btn btn-success">
Add sensor
</button>
<button @click="removeSensor" class="btn btn-danger">
Remove sensor
</button>
</div>
<div class="info">
<p>Sensor map uses <code>markRaw()</code></p>
<p>Only the <code>activeSensors</code> counter is reactive</p>
</div>
<div class="code-box">
<pre>const network = reactive({
activeSensors: 0,
// Map doesn't need to be reactive
sensors: markRaw(new Map())
})
// Update only the reactive counter
network.activeSensors = network.sensors.size</pre>
</div>
</div>
</div>
<!-- Library integration -->
<div class="library-section">
<h2>Integration with external libraries</h2>
<div class="library-card">
<h3>{{ chartConfig.title }}</h3>
<div class="chart-placeholder">
<div class="chart-visual">
Reactor power chart
</div>
<p>Chart instance: {{ chartConfig.chartInstance.render() }}</p>
</div>
<button @click="updateChart" class="btn btn-info">
Update chart
</button>
<div class="code-box">
<pre>import Chart from 'chart-library'
const config = reactive({
title: 'My Chart',
// Large library - we don't need reactivity
chartInstance: markRaw(new Chart())
})
// Manually update when needed
config.chartInstance.update(newData)</pre>
</div>
</div>
</div>
<!-- toRaw() demo -->
<div class="toraw-section">
<h2>toRaw() - Access to the original object</h2>
<div class="toraw-card">
<p>Sometimes you need access to the original, non-reactive object</p>
<button @click="getRawReactor" class="btn btn-warning">
Get RAW reactor (check console)
</button>
<div class="code-box">
<pre>const reactive = reactive({ value: 1 })
// Get the original object
const raw = toRaw(reactive)
// Changes in raw will NOT trigger reactivity
raw.value = 2
console.log(isReactive(raw)) // false</pre>
</div>
<div class="use-cases">
<h4>When to use toRaw()?</h4>
<ul>
<li>Passing to API that doesn't need reactivity</li>
<li>Operations on raw data without triggering reactivity</li>
<li>Debugging - checking original values</li>
</ul>
</div>
</div>
</div>
<!-- Info box -->
<div class="info-box">
<h3>When to use markRaw()?</h3>
<div class="use-cases-grid">
<div class="use-case">
<h4>Large data objects</h4>
<p>Gigantic data structures that don't need to be reactive</p>
</div>
<div class="use-case">
<h4>External libraries</h4>
<p>Chart.js, Three.js, D3.js instances - don't need reactivity</p>
</div>
<div class="use-case">
<h4>Map, Set, WeakMap</h4>
<p>Collections you change frequently, but don't need to track every change</p>
</div>
<div class="use-case">
<h4>Performance optimization</h4>
<p>When reactivity slows down the application unnecessarily</p>
</div>
</div>
<div class="warning-box">
<h4>Warning!</h4>
<p><code>markRaw()</code> is irreversible - the object will never become reactive!</p>
<p>Use only when you are sure that reactivity is not needed.</p>
</div>
</div>
</div>
</template>
<style scoped>
.mark-raw-demo {
min-height: 100vh;
background: #0a0e27;
color: #e0e0e0;
padding: 2rem;
font-family: 'Courier New', monospace;
}
.header {
text-align: center;
margin-bottom: 2rem;
border-bottom: 2px solid #00ff88;
padding-bottom: 1rem;
}
.header h1 {
color: #00ff88;
font-size: 2rem;
margin: 0;
text-shadow: 0 0 10px #00ff88;
}
.subtitle {
color: #00b4d8;
margin: 0.5rem 0 0 0;
}
.comparison-section,
.sensors-section,
.library-section,
.toraw-section {
background: #1a1f3a;
padding: 1.5rem;
border-radius: 8px;
border: 1px solid #00b4d8;
margin-bottom: 2rem;
}
h2 {
color: #00ff88;
margin-top: 0;
}
.reactors-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
gap: 1.5rem;
}
.reactor-card,
.sensors-card,
.library-card,
.toraw-card {
background: #0a0e27;
padding: 1.5rem;
border-radius: 6px;
}
.reactor-header,
.sensors-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 1px solid #333;
}
.reactor-header h3,
.sensors-header h3 {
color: #00b4d8;
margin: 0;
}
.badge {
padding: 0.3rem 0.8rem;
border-radius: 20px;
font-size: 0.8rem;
font-weight: bold;
}
.badge-reactive {
background: #ff8800;
color: #0a0e27;
}
.badge-optimized {
background: #00ff88;
color: #0a0e27;
}
.reactor-stats {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
margin-bottom: 1.5rem;
}
.stat {
background: #1a1f3a;
padding: 1rem;
border-radius: 4px;
}
.stat .label {
font-size: 0.85rem;
color: #888;
margin-bottom: 0.3rem;
}
.stat .value {
font-size: 1.2rem;
color: #00ff88;
font-weight: bold;
}
.simulation-info {
background: #1a1f3a;
padding: 1rem;
border-radius: 4px;
margin-bottom: 1rem;
}
.simulation-info p {
margin: 0.5rem 0;
}
.simulation-info strong {
color: #00ff88;
}
.warning {
color: #ff8800;
}
.success {
color: #00ff88;
}
.btn {
width: 100%;
padding: 1rem;
font-size: 1rem;
border: none;
border-radius: 6px;
cursor: pointer;
font-weight: bold;
transition: all 0.3s ease;
font-family: 'Courier New', monospace;
margin-bottom: 1rem;
}
.btn-primary {
background: linear-gradient(135deg, #00b4d8, #0088cc);
color: white;
}
.btn-success {
background: linear-gradient(135deg, #00ff88, #00dd77);
color: #0a0e27;
}
.btn-danger {
background: linear-gradient(135deg, #ff4444, #cc0000);
color: white;
}
.btn-info {
background: linear-gradient(135deg, #00b4d8, #00ff88);
color: #0a0e27;
}
.btn-warning {
background: linear-gradient(135deg, #ffaa00, #ff8800);
color: #0a0e27;
}
.btn:hover {
transform: scale(1.02);
box-shadow: 0 0 20px currentColor;
}
.code-box {
background: #1a1f3a;
padding: 1rem;
border-radius: 4px;
border-left: 3px solid #00ff88;
}
.code-box pre {
margin: 0;
color: #00ff88;
font-size: 0.85rem;
overflow-x: auto;
}
.sensor-count {
color: #00ff88;
font-weight: bold;
}
.sensors-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 1rem;
margin: 1.5rem 0;
}
.sensor-item {
background: #1a1f3a;
padding: 1rem;
border-radius: 4px;
border-left: 3px solid #00b4d8;
}
.sensor-id {
color: #00b4d8;
font-weight: bold;
font-size: 0.9rem;
}
.sensor-type {
color: #888;
font-size: 0.85rem;
margin: 0.3rem 0;
text-transform: uppercase;
}
.sensor-value {
color: #00ff88;
font-size: 1.2rem;
font-weight: bold;
}
.controls {
display: flex;
gap: 1rem;
}
.controls .btn {
flex: 1;
}
.info {
background: #1a1f3a;
padding: 1rem;
border-radius: 4px;
margin-top: 1rem;
}
.info p {
margin: 0.5rem 0;
color: #ccc;
}
.info code {
background: #0a0e27;
padding: 0.2rem 0.5rem;
border-radius: 3px;
color: #00ff88;
}
.chart-placeholder {
background: #1a1f3a;
padding: 2rem;
border-radius: 4px;
text-align: center;
margin: 1rem 0;
}
.chart-visual {
font-size: 3rem;
margin-bottom: 1rem;
}
.use-cases {
background: #1a1f3a;
padding: 1rem;
border-radius: 4px;
margin-top: 1rem;
}
.use-cases h4 {
color: #00b4d8;
margin-top: 0;
}
.use-cases ul {
color: #ccc;
padding-left: 1.5rem;
}
.use-cases li {
margin: 0.5rem 0;
}
.info-box {
background: #1a1f3a;
padding: 1.5rem;
border-radius: 8px;
border-left: 4px solid #00ff88;
}
.info-box h3 {
color: #00ff88;
margin-top: 0;
}
.use-cases-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1rem;
margin: 1rem 0;
}
.use-case {
background: #0a0e27;
padding: 1rem;
border-radius: 4px;
}
.use-case h4 {
color: #00b4d8;
margin-top: 0;
}
.use-case p {
color: #ccc;
margin: 0;
font-size: 0.9rem;
}
.warning-box {
background: #2a1f1a;
border: 2px solid #ff8800;
padding: 1rem;
border-radius: 4px;
margin-top: 1rem;
}
.warning-box h4 {
color: #ffaa00;
margin-top: 0;
}
.warning-box p {
color: #ccc;
margin: 0.5rem 0;
}
.warning-box code {
background: #0a0e27;
padding: 0.2rem 0.5rem;
border-radius: 3px;
color: #00ff88;
}
</style>Docs entries used in this lesson
Spotted a mistake in this lesson?
Check yourself
Answer the questions from this lesson. Pick an answer to see right away whether it is correct.
1. What is the recommended approach to reactivity in Vue 3?
2. What mechanism does Vue 3 use to implement reactivity?
These are 2 of 11 questions for this lesson. Solve the rest in the game.
Hands-on tasks in the game
- Code editor
Create a reactive object and wrap it in readonly() to protect it from changes.
- Vertical ordering
Arrange the steps for using readonly in a component in the correct order.
- Click in order
Arrange the steps for using markRaw with an external library in the correct order.
- Code editor
Use markRaw() for an object that doesn't need reactivity (e.g., a library instance or configuration).
- Vertical ordering
Arrange the steps for optimizing with triggerRef() in the correct order.
- Click in order
Arrange the import statement for reactive functions in the correct order.
- Vertical ordering
Arrange the reactivity concepts from simplest to most advanced.
- Vertical ordering
Arrange the steps for using shallowRef in the correct order.
- Vertical ordering
Arrange the steps for designing state in a component in the correct order.
- Click in order
Arrange the steps for creating a reactive form in the correct order.
Tasks after this lesson
- QuestionRecommended reactivity practices
- QuestionProxy API in Vue 3
- Coding taskPractice: readonly()
- QuestionThe readonly() function
- Put in orderreadonly pattern in a component
- QuestionThe markRaw() function
- Click in orderUsing markRaw with a library
- Coding taskPractice: markRaw() external objects
- QuestionAdvanced reactivity API
- QuestionThe triggerRef() function
- QuestionPerformance with shallowRef
- Put in orderOptimization with triggerRef
- QuestionChoosing a reactivity tool
- QuestionMutating reactive - direct
- Click in orderImporting reactive APIs
- Put in orderFrom simple to advanced
- QuestionDestructuring and toRefs
- Put in ordershallowRef syntax
- Put in orderState architecture in a component
- Click in orderCreating a reactive form
- QuestionThe isReactive() function