Dynamic add target class not make component moveable
See original GitHub issueEnvironments
- Framework name: Vue
- Framework version: 3.2.33
- Moveable Component version: vue-3moveable 0.10.4
- Testable Address(optional): https://codesandbox.io/s/keen-volhard-hou32e?file=/src/App.vue
Description
Have simple draft of moveable in vue. Page have 2 buttons, first button onclick add class ‘target’ to second button by vue data. I’m expect that after add class ‘target’, button should be moveable. What is wrong?
Possible after add class to element, i should call some moveable method to start work?
<div>
<button @click="btnClick">Add target class</button>
</div>
<component
:is="'SimpleButton'"
:class="className"
@mousedown="mousedown"
/>
<Moveable
ref="moveable"
:target="target"
:draggable="true"
@drag="onDrag"
/>
data() {
return {
target: [".target"],
className: "test-class",
draggable: true,
};
},
...
btnClick(e) {
this.className = "target";
},
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How can I target dynamic classNames? [closed] - Stack Overflow
1 Answer 1 ... It targets all elements with class attribute starting with "avatarDefault". You can also use [class*="avatarDefault"] which targets ...
Read more >Using the HTML5 Drag and Drop API - web.dev
The HTML5 Drag and Drop API means that we can make almost any element on our page draggable. In this post we'll explain...
Read more >Create Dynamic Target Line in Excel Bar Chart
Creating a Dynamic Target Line in Excel Bar Chart · Go to Insert –> Charts –> Clustered Column Chart · Select any of...
Read more >Shadow DOM slots, composition
We could try to analyze the element content and dynamically copy-rearrange DOM nodes. That's possible, but if we're moving elements to shadow ...
Read more >Dynamically Switching From One HTML Element to Another in ...
A friend once contacted me asking if I had a way to dynamically change one HTML element into another within Vue's template block....
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
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@actorius
moveable’s new version is released.
updateSelectors is missing. try again
Ok, looks better. It’s should be used with
nextTick
, otherwise element setting moveable only on second click.Sandbox updated: Updated