V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
dongtingyue
V2EX  ›  问与答

求自 vue 中引入 mqtt 报错问题

  •  
  •   dongtingyue · Apr 27, 2023 · 1153 views
    This topic created in 1096 days ago, the information mentioned may be changed or developed.
    npm run 起的开发环境
    ```
    import mqtt from 'mqtt'
    ....
    Vue.prototype.mqtt = mqtt
    ```
    为了全局使用 mqtt ,不用每个地方都用 import
    mqtt client.jst
    ```
    const nextTick = process ? process.nextTick : function (callback) {
    setTimeout(callback, 0);
    };
    ```
    报错
    process is not defined
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3384 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 12:53 · PVG 20:53 · LAX 05:53 · JFK 08:53
    ♥ Do have faith in what you're doing.