Closed Kchin-project closed 6 years ago
You shouldn't use setAttrbute, even Vue directives won't work for you (e.g. v-if, v-on)
Please check : https://stackoverflow.com/questions/30546370/how-to-make-vue-js-directive-working-in-an-appended-html-element
Hi, I'm trying to attach the directive to a dynamically created rect but is not working I'm trying this inside a method:
var xmlns = "http://www.w3.org/2000/svg"; var stage = document.createElementNS(xmlns, "rect"); stage.setAttributeNS(null, 'v-draggable', ''); stage.setAttributeNS(null, 'width', 350); stage.setAttributeNS(null, 'height', 80); stage.style.cssText = 'fill:#f2f2f2;stroke-width:1;stroke:rgb(0,0,0)'; console.log(stage) document.getElementById('canvas').appendChild(stage)