Vuejs2 为什么;onStartDrag“;在Vue JSX中不起作用? 导出默认值{ 安装的(){ //只有这样,看,这是效果,才能发挥作用 这是。$refs.hah.ondragstart=函数(){ 控制台日志(8888) } }, 方法:{ myDragStart(){ console.log(“启动…”) } }, render(){ //但是在JSX中,它没有效果,onDragStart不能使用!为什么? const self=这个; 返回(BBB) }

Vuejs2 为什么;onStartDrag“;在Vue JSX中不起作用? 导出默认值{ 安装的(){ //只有这样,看,这是效果,才能发挥作用 这是。$refs.hah.ondragstart=函数(){ 控制台日志(8888) } }, 方法:{ myDragStart(){ console.log(“启动…”) } }, render(){ //但是在JSX中,它没有效果,onDragStart不能使用!为什么? const self=这个; 返回(BBB) },vuejs2,Vuejs2,} 大家好,我有一个问题,“onStartDrag”在Vue JSX中不起作用,但它对DOM事件的影响是“ondragstart”事件。我不知道该怎么办 export default { mounted(){ //only do this, look, this is effect, can usefull this.$refs.hah.ondragstart = function(){ console.log(8888) } }, methods:{

}

大家好,我有一个问题,“onStartDrag”在Vue JSX中不起作用,但它对DOM事件的影响是“ondragstart”事件。我不知道该怎么办

export default {

mounted(){
    //only do this, look, this is effect, can usefull

    this.$refs.hah.ondragstart = function(){
      console.log(8888)
    }
},
methods:{
    myDragStart(){
        console.log("Start....")
    }
},
render() {
    //but in JSX, its not effect , the onDragStart can not use! why?
    const self = this;
    return (<div ref={'hah'} style={{color:'red',position:'absolute',left:'200px'}}
                 onDragStart={self.myDragStart.bind(self)}
                 draggable={"true"}>bbbbb</div>)

}