瀏覽代碼

chore: 融合参数名

hujinliang 4 年之前
父節點
當前提交
f4b1d6d7f8
共有 4 個文件被更改,包括 7 次插入7 次删除
  1. 3 3
      web/dist/vap.js
  2. 0 0
      web/dist/vap.min.js
  3. 1 1
      web/package.json
  4. 3 3
      web/src/vap-frame-parser.ts

+ 3 - 3
web/dist/vap.js

@@ -1148,7 +1148,7 @@
                   case 0:
                     item.img = null;
 
-                    if (this.headData[item.srcTag.slice(1, item.srcTag.length - 1)]) {
+                    if (!(!this.headData[item.srcTag.slice(1, item.srcTag.length - 1)] && !this.headData[item.srcTag])) {
                       _context2.next = 5;
                       break;
                     }
@@ -1167,7 +1167,7 @@
                       item['fontStyle'] = this.headData['fontStyle'];
                     }
 
-                    item.textStr = item.srcTag.replace(/\[(.*)\]/, function ($0, $1) {
+                    item.textStr = this.headData[item.srcTag] || item.srcTag.replace(/\[(.*)\]/, function ($0, $1) {
                       return _this2.headData[$1];
                     });
                     item.img = this.makeTextImg(item);
@@ -1180,7 +1180,7 @@
                       break;
                     }
 
-                    item.imgUrl = item.srcTag.replace(/\[(.*)\]/, function ($0, $1) {
+                    item.imgUrl = this.headData[item.srcTag] || item.srcTag.replace(/\[(.*)\]/, function ($0, $1) {
                       return _this2.headData[$1];
                     });
                     _context2.prev = 13;

File diff suppressed because it is too large
+ 0 - 0
web/dist/vap.min.js


+ 1 - 1
web/package.json

@@ -1,6 +1,6 @@
 {
   "name": "video-animation-player",
-  "version": "0.2.9",
+  "version": "0.2.10",
   "description": "webgl动画特效组件",
   "main": "dist/vap.js",
   "scripts": {

+ 3 - 3
web/src/vap-frame-parser.ts

@@ -71,19 +71,19 @@ export default class FrameParser {
     return Promise.all(
       (dataJson.src || []).map(async item => {
         item.img = null;
-        if (!this.headData[item.srcTag.slice(1, item.srcTag.length - 1)]) {
+        if (!this.headData[item.srcTag.slice(1, item.srcTag.length - 1)] && !this.headData[item.srcTag]) {
           console.warn(`vap: 融合信息没有传入:${item.srcTag}`);
         } else {
           if (item.srcType === 'txt') {
             if (this.headData['fontStyle'] && !item['fontStyle']) {
               item['fontStyle'] = this.headData['fontStyle']
             }
-            item.textStr = item.srcTag.replace(/\[(.*)\]/, ($0, $1) => {
+            item.textStr = this.headData[item.srcTag] || item.srcTag.replace(/\[(.*)\]/, ($0, $1) => {
               return this.headData[$1];
             });
             item.img = this.makeTextImg(item);
           } else if (item.srcType === 'img') {
-            item.imgUrl = item.srcTag.replace(/\[(.*)\]/, ($0, $1) => {
+            item.imgUrl = this.headData[item.srcTag] || item.srcTag.replace(/\[(.*)\]/, ($0, $1) => {
               return this.headData[$1]
             });
             try {

Some files were not shown because too many files changed in this diff