Skip to content

Commit

Permalink
Merge pull request #147 from 0x15F9/post
Browse files Browse the repository at this point in the history
Make use of declared variable
  • Loading branch information
netchampfaris authored May 26, 2024
2 parents c571415 + d8f85c7 commit 2685757
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/resources/Resource.story.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ to reload your data.
When you create a resource using the `createResource` function, it will create a
reactive object with properties like `data`, `loading`, `error`, `reload()` etc.

The default request method is `POST`. This can be changed in the `options`
object.

```vue
<template>
<Button @click="post.reload()" :loading="post.loading"> Reload </Button>
Expand All @@ -36,6 +39,7 @@ reactive object with properties like `data`, `loading`, `error`, `reload()` etc.
import { createResource } from 'frappe-ui'
let post = createResource({
url: 'https://jsonplaceholder.typicode.com/posts/1',
method: 'GET',
})
post.fetch()
</script>
Expand Down Expand Up @@ -227,8 +231,8 @@ service.

```vue
<template>
<Button @click="post.reload()" :loading="post.loading"> Reload </Button>
<pre>{{ post }}</pre>
<Button @click="todos.reload()" :loading="todos.loading"> Reload </Button>
<pre>{{ todos }}</pre>
</template>
<script setup>
Expand Down

0 comments on commit 2685757

Please sign in to comment.