代码之家  ›  专栏  ›  技术社区  ›  CCCC

solana-/node_modules/@toruslabs/eccrypto/index。js:函数外的“return”

  •  0
  • CCCC  · 技术社区  · 5 年前

    我在用 vue 对于 solana 发展

    我使用的图书馆是 @solana/wallet-adapter

    错误显示:

    /node_modules/@toruslabs/eccrypto/index.js: 'return' outside of function 
    

    因为这个例子只适用于 React ,我很难找到错误的根本原因。

    应用程序。vue

    <template>
      <div id="app">
        <WalletConnectButton/>
      </div>
    </template>
    
    <script>
    import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-vue';
    import { WalletAdapterNetwork } from '@solana/wallet-adapter-base';
    import {
        getLedgerWallet,
        getPhantomWallet,
        getSlopeWallet,
        getSolflareWallet,
        getSolletExtensionWallet,
        getSolletWallet,
        getTorusWallet,
    } from '@solana/wallet-adapter-wallets';
    import {
        WalletDisconnectButton,
        WalletMultiButton,
        WalletConnectButton
    } from '@solana/wallet-adapter-vue-ui';
    import { clusterApiUrl } from '@solana/web3.js';
    
    
    export default {
      name: "App",
      components: {
        
      }
    };
    </script>
    
    <style>
    #app {
      font-family: "Avenir", Helvetica, Arial, sans-serif;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      text-align: center;
      color: #2c3e50;
      margin-top: 60px;
    }
    </style>
    

    代码沙盒
    https://codesandbox.io/s/strange-oskar-j1byt?file=/src/App.vue:0-906

    0 回复  |  直到 5 年前
        1
  •  0
  •   0xgio    5 年前

    我不确定这是否有帮助,但可能模块丢失了。 npm i @toruslabs/eccrypto

    推荐文章