Skip to content

Commit f40f7ee

Browse files
authored
Add readonly import to code sample (#378)
1 parent 2da7987 commit f40f7ee

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/guide/reactivity-fundamentals.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ You can learn more about `refs` in the [Refs API](../api/refs-api.html#ref) sect
150150
Sometimes we want to track changes of the reactive object (`ref` or `reactive`) but we also want prevent changing it from a certain place of the application. For example, when we have a [provided](component-provide-inject.html) reactive object, we want to prevent mutating it where it's injected. To do so, we can create a readonly proxy to the original object:
151151

152152
```js
153+
import { reactive, readonly } from 'vue'
154+
153155
const original = reactive({ count: 0 })
154156

155157
const copy = readonly(original)

0 commit comments

Comments
 (0)