vue-at icon indicating copy to clipboard operation
vue-at copied to clipboard

希望embeddedItem加入对event的处理

Open von7750 opened this issue 4 years ago • 2 comments

对于自定义的embeddedItem似乎不支持事件的处理..

            <template v-slot:embeddedItem="s">
                <span><span class="tag" @click="$log(123)">123123</span></span>
            </template>

von7750 avatar May 25 '20 10:05 von7750

@von7750 对目前只是提取innerHTL进行简单的插入,还没找到办法能在这支持vue语法 embededItem.innerHTML调用处 https://github.com/fritx/vue-at/blob/dev/src/At.vue#L468-L469

fritx avatar May 27 '20 03:05 fritx

这块弄好了,把innerHTML 给改了 改成直接移动节点, 这样所有的事件都会保留 AtTemplate.vue <span v-show="false" ref="embeddedItem"> <slot v-for="i in enterList" name="embeddedItem" :current="i"></slot> </span>

这里用list是因为发现移动后 后面再用@ 就渲染到我移动后的那个节点上了。

但是还有个问题, 提交到服务器后, 下次再进来这里的事件肯定会失效了。 还是要再处理一次, 好像没有什么好办法

von7750 avatar May 28 '20 08:05 von7750