2017-10-19 22 views
1

我試圖將PV (protein viewer)與React集成,但無法做到這一點,嘗試搜索,我認爲我是第一個這樣做。雖然我遵循指南here我仍然無法使其工作。將PV(蛋白質查看器)與React集成

到目前爲止,這是我想出的。

import React, { Component } from 'react' 

class pv extends Component { 

    componentDidMount() { 
    this.el = this.pvDiv 
    this.viewer = pv.Viewer(this.el, { width : 'auto', height : 'auto', antialias : true }) 
    this.viewer.on('viewerReady', function() { 
     console.log('ready!') 
    }) 
    } 

    render(){ 
    return(
     <div> 
      <div ref={el => this.pvDiv = el}/> 
     </div> 
    ); 
    } 

} 

export default pv; 
+0

是'console.log'日誌?並且你是否在任何地方導入'pv'對象,或者是使用'

相關問題