Extend example in doc
See original GitHub issueHi there. Great job already! Thank you guys.
Would really love to see an example of how to pass a prop to a custom extension.
for example i copied your TodoItem
-extension and tried to pass an object in like this:
<ul data-type="todo_list">
<li
:custom-prop="customProp"
data-type="todo_item"
data-done="true">
Buy beer
</li>
</ul>
and then tried to use this custom-prop inside of the template logic of TodoItem
, but it wasn’t available there.
is there a way to achive something like this? an example-code for this in the doc would help not only me, but also other.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
extend — Python Reference (The Right Way) 0.1 documentation
Extends the list by appending all the items from the iterable. Syntax¶. list. extend(iterable). iterable: Required. Any iterable type.
Read more >jQuery.extend() | jQuery API Documentation
When two or more object arguments are supplied to $.extend() , properties from all of the objects are added to the target object....
Read more >extends - The flexible, fast, and secure PHP template engine
In this example, the template will extend the "minimum.html" layout template if the standalone variable evaluates to true , and "base.html" otherwise. How...
Read more >extends - JavaScript - MDN Web Docs - Mozilla
The extends keyword is used in class declarations or class expressions to create a class that is a child of another class.
Read more >Sass: @extend
When one class extends another, Sass styles all elements that match the extender as though they also match the class being extended. When...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, I think I know what you have tried to do. You wanted to pass custom props like this right?
You’ll have to add
custom-prop
to your schema correctly. Based on thetodo_item
extension this will look something like this:After that you will have access to
customProp
in your vue component:Please note that customProp will not be reactive, because everything you pass to the editor will be parsed and rendered from Prosemirror. So any reactivity breaks here. If you need reactivity here, you’ll have to use some state management like Vuex.
@rameezcubet You can bind v-model to a computed with get() and set() like this