vue-moveable
vue-moveable copied to clipboard
I customized ables in vue2.0 and never displayed them. I don't know why
ables: { name: "mouseTest", props: {}, events: {}, render(moveable, React) { const CustomElement = moveable.useCSS( "div",
{
position: absolute;
}
); // Add key (required) // Add class prefix moveable-(required) return moveable.createElement("div", {}, "lietu"); }, mouseEnter() { console.log("ENTER"); }, mouseLeave() { console.log("LEAVE"); } },
这是我在 vue data中定义的组件数据
solved this by queryElement
looks like this

js
this.$nextTick(() => {
// query bottom button
const sButton = document.querySelector('div[data-direction="s"]');
// insert Html
sButton.innerHTML = `<div class="double">双击修改文字<div>`;
const effect=this.doSomething;
// query inserted and addEventListener
document.querySelector(".double").addEventListener( "touchend", effect );
});
css
.double {
width: 200px;
text-align: center;
height: 60px;
line-height: 60px;
border-radius: 10px;
position: absolute;
bottom: -70px;
background: rgba(#000, 0.8);
color: #fff;
left: 50%;
transform: translateX(-50%);
font-size: 0.8rem;
}