其他分享
首页 > 其他分享> > Rust to WebAssembly using js console.log All In One

Rust to WebAssembly using js console.log All In One

作者:互联网

Rust to WebAssembly using js console.log All In One

# build the package
$  wasm-pack build --target web
<!DOCTYPE html>
<html lang="zh-Hans">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="author" content="xgqfrms">
    <meta name="generator" content="VS code">
    <title>Rust to WebAssembly using js console.log All In One</title>
</head>
<body>
  <header>
      <h1>Rust to WebAssembly using js console.log All In One</h1>
  </header>
  <main>
      <section>
          <a href="https://www.cnblogs.com/xgqfrms/p/16685185.html">Rust to WebAssembly</a>
      </section>
  </main>
  <footer>
      <p>copyright&copy; xgqfrms 2022</p>
  </footer>
  <script type="module">
    import init, { greet } from "./pkg/rust_to_wasm_npm.js";
    init().then(() => {
      // greet("Rust to WebAssembly and run wasm in js 

标签:WebAssembly,console,log,bindgen,js,wasm,Rust
来源: https://www.cnblogs.com/xgqfrms/p/16685185.html