Skip to content

Commit

Permalink
Fix the intendataion of the paragraph of the blog (#121)
Browse files Browse the repository at this point in the history
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
  • Loading branch information
SagarGi committed Mar 12, 2024
1 parent 5ff4e8d commit 4ad9254
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ In this demo app the properties `data`, `methods`, `computed`, and `watch` have
## Converting to ****Composition API****

### 1. Defining ****data****
When defining the data necessary for a component, in `Composition API`, we have to make it reactive to mutate or change values with `ref` or `reactive` provided by Vue.js.
So data property can be defined as:
When defining the data necessary for a component, in `Composition API`, we have to make it reactive to mutate or change values with `ref` or `reactive` provided by Vue.js.
So data property can be defined as:
```js
// data
const data = reactive({
Expand All @@ -89,7 +89,7 @@ In this demo app the properties `data`, `methods`, `computed`, and `watch` have
```

### 2. Defining ****methods****
Defining the methods is very simple. It is just as easy as defining functions in JavaScript.
Defining the methods is very simple. It is just as easy as defining functions in JavaScript.
```js
// methods
function increaseAge() {
Expand All @@ -103,7 +103,7 @@ In this demo app the properties `data`, `methods`, `computed`, and `watch` have
The above function changes the `age` property of the data defined in `data` which is reactive.

### 3. Defining ****computed****
To define the computed property Vue provides the method called `computed` through which we can explicitly define the computed function.
To define the computed property Vue provides the method called `computed` through which we can explicitly define the computed function.
```js
//computed
const getVotingStatus = computed(() => {
Expand All @@ -113,7 +113,7 @@ In this demo app the properties `data`, `methods`, `computed`, and `watch` have
Here the operation `getVotingStatus` returns the voting status based on value of age.

### 4. Defining ****watch****
Similarly, Vue has provided a `watch` function to watch the change in any data properties defined.
Similarly, Vue has provided a `watch` function to watch the change in any data properties defined.
```js
//watcher
watch(mainData.age, (oldAge, newAge) => {
Expand Down

0 comments on commit 4ad9254

Please sign in to comment.