Skip to content

react 下使用问题 #4

Open
Open
@superwunc

Description

Hi,
我参考react 下的demo ,代码如下

import React from "react";
import HQChart from "hqchart";

class KLine extends React.Component {
  constructor(props) {
    //构造函数
    super(props);
    this.initCanvas = this.initCanvas.bind(this);
    this.state = {
      Symbol: "600000.sh",
      KLine: {
        JSChart: null,
        Option: {
          Symbol: "",
          Type: "历史K线图",

          //窗口指标
......

编译的时候,出现下面的错误

ERROR in ../node_modules/hqchart/src/jscommon/umychart.vue/umychart.stock.vue.js
Module not found: Error: Can't resolve 'jquery' in 'C:\clarkwu\stock_app\node_modules\hqchart\src\jscommon\umychart.vue'
 @ ../node_modules/hqchart/src/jscommon/umychart.vue/umychart.stock.vue.js 1274:8-9 1298:12-13 1809:8-9 1853:8-9 1898:8-9 1943:9-10 1988:8-9 2032:8-9 2058:8-9 2144:8-9 2206:8-9 2231:8-9 2259:8-9 2286:8-9 2825:8-9 2946:8-9 3007:8-9 3164:8-9 3238:8-9 3313:8-9 3367:8-9 3580:8-9 3662:8-9 3770:4-5 3841:0-22
 @ ../node_modules/hqchart/index.js
 @ ./src/components/KLine/index.js
 @ ./src/main.js

我看代码/node_modules/hqchart/index.js

//行情图形库
module.exports.Chart = require('./src/jscommon/umychart.vue/umychart.vue.js').default;

//行情股票数据接口类
module.exports.Stock = require('./src/jscommon/umychart.vue/umychart.stock.vue.js').default;

我看是vue的代码,问一下react下使用,正确的方式是什么?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions