-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: expose
createSanityDataAttribute
utility (#1042)
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Visual Editing | ||
|
||
--- | ||
|
||
When visual editing is enabled, this module exports a `createSanityDataAttribute` helper function which allows you to manually map content in a component to its source. | ||
|
||
It is globally available throughout your project (both within your server routes and your Vue app) via auto-imports. | ||
|
||
See the [Sanity documentation](https://www.sanity.io/docs/visual-editing-overlays#cb95b19a0263) for more information. | ||
|
||
## Example | ||
|
||
```vue | ||
<template> | ||
<h1 :data-sanity="createSanityDataAttribute({ | ||
id: 'the-godfather', | ||
type: 'movie', | ||
path: 'title', | ||
})">The Godfather</h1> | ||
</template> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters