소스 검색

fix: 修复rive cnd问题

lvkun996 1 년 전
부모
커밋
eb82a467db
6개의 변경된 파일9개의 추가작업 그리고 16개의 파일을 삭제
  1. 2 9
      index.html
  2. 0 1
      package.json
  3. 4 1
      src/main.ts
  4. 1 4
      src/service/index.ts
  5. 2 1
      src/static/rive.js
  6. BIN
      src/static/rive.wasm

+ 2 - 9
index.html

@@ -21,15 +21,8 @@
   <body>
     <div id="app"><!--app-html--></div>
     <script type="module" src="/src/main.ts"></script>
+    <script src="./static/rive.js">
+    </script>
   </body>
-  <script src="src/static/rive.js"></script>
-  <script>
-    window['rive'] = rive.Rive
-    
-    console.log('rive.Rive:', rive.Rive);
-  </script>
-  <!-- <script>
-    window['rive'] = rive.Rive
-  </script> -->
 
 </html>

+ 0 - 1
package.json

@@ -55,7 +55,6 @@
     "js-base64": "^3.7.5",
     "less-loader": "^6.2.0",
     "lottie-web": "^5.12.2",
-    "my-rive": "file:src/npm",
     "pinia": "^2.0.33",
     "vconsole": "^3.15.0",
     "vue": "^3.2.45",

+ 4 - 1
src/main.ts

@@ -4,7 +4,7 @@ import * as Pinia from 'pinia'
 import staticImg from '@/utils/static'
 import VConsole from "vconsole"
 
-new VConsole()
+// new VConsole()
 
 // console.log('rive:', rive.Rive);
 
@@ -15,6 +15,9 @@ new VConsole()
 // script.src = './src/npm/rive.js'
 // window['rive'] = rive.Rive
 
+// console.log('rive:',  rive.Rive);
+window['rive'] = rive.Rive
+
 export function createApp() {
   const app = createSSRApp(App);
   app.use(Pinia.createPinia())

+ 1 - 4
src/service/index.ts

@@ -12,10 +12,7 @@ interface Params {
 
 // const BASEURL = import.meta.env.MODE === 'development' ? 'http://local.luojigou.vip:8888' : 'https://open.api.luojigou.vip'
 const BASEURL = import.meta.env.MODE === 'development' ? 'https://open.test.luojigou.vip' : 'https://open.api.luojigou.vip'
-//  'https://open.test.luojigou.vip'
-// window.location.href.split('#')[0] + 'zd-api'
-// https://open.test.luojigou.vip
-//  "https://open.api.luojigou.vip"
+
 
 export const request = async <T>(
   params: Params

+ 2 - 1
src/static/rive.js

@@ -640,7 +640,8 @@ var RuntimeLoader = /** @class */ (function () {
     RuntimeLoader.callBackQueue = [];
     // Path to the Wasm file; default path works for testing only;
     // if embedded wasm is used then this is never used.
-    RuntimeLoader.wasmURL = "https://unpkg.com/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive.wasm");
+    // RuntimeLoader.wasmURL = "https://unpkg.com/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive.wasm");
+    RuntimeLoader.wasmURL = './rive.wasm';
     return RuntimeLoader;
 }());
 

BIN
src/static/rive.wasm