ソースを参照

更新ast解析

jh t 9 ヶ月 前
コミット
5a0cdd968a
1 ファイル変更25 行追加0 行削除
  1. 25 0
      lib/ast/astparser.js

+ 25 - 0
lib/ast/astparser.js

@@ -2283,6 +2283,15 @@ class AstParserPlugin_Selector extends AstParserPlugin {
                         if (selectorParent.parent.arguments?.length == 1) {
                             if (selectorParent.parent.arguments[0].type == AstNode.ObjectExpression) {
                                 ret.kind = "修改样式";
+
+                                let props = [];
+                                for (let prop of selectorParent.parent.arguments[0].properties) {
+                                    props.push({
+                                        name: (prop.key.type == AstNode.Identifier) ? prop.key.name : prop.key.value,
+                                        defineNode: prop,
+                                    });
+                                }
+                                ret.kindDes = props;
                             }
                             else {
                                 ret.kind = "获取属性/元素";
@@ -2290,6 +2299,22 @@ class AstParserPlugin_Selector extends AstParserPlugin {
                         }
                         else {
                             ret.kind = "修改样式";
+
+                            let propName = "";
+
+                            if (selectorParent.parent.arguments[0].type == AstNode.Identifier) {
+                                propName = selectorParent.parent.arguments[0].name;
+                            }
+                            else {
+                                propName = selectorParent.parent.arguments[0].value;
+                            }
+
+                            ret.kindDes = [
+                                {
+                                    name: propName,
+                                    defineNode: selectorParent.parent.arguments[0],
+                                }
+                            ]
                         }
 
                         return ret;