Kaynağa Gözat

add vetur typing config

Michael Wang 4 yıl önce
ebeveyn
işleme
a78627bd68
3 değiştirilmiş dosya ile 57 ekleme ve 0 silme
  1. 4 0
      package.json
  2. 38 0
      vetur/attributes.json
  3. 15 0
      vetur/tags.json

+ 4 - 0
package.json

@@ -32,5 +32,9 @@
     "typescript": "^4.2.4",
     "vite": "^2.3.2",
     "vue-tsc": "^0.0.24"
+  },
+  "vetur": {
+    "tags": "vetur/tags.json",
+    "attributes": "vetur/attributes.json"
   }
 }

+ 38 - 0
vetur/attributes.json

@@ -0,0 +1,38 @@
+{
+  "qm-button/disabled": {
+    "type": "boolean",
+    "description": "disabled state of button, Default: `false`"
+  },
+  "qm-button/ghost": {
+    "type": "boolean",
+    "description": "make background transparent and invert text and border colors, added in 2.7, Default: false"
+  },
+  "qm-button/htmlType": {
+    "type": "string",
+    "description": "set the original html `type` of `button`, see: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type), Default: `button`"
+  },
+  "qm-button/icon": {
+    "type": "v-slot",
+    "description": "set the icon of button, see: Icon component, Default: -"
+  },
+  "qm-button/loading": {
+    "type": "boolean | { delay: number }",
+    "description": "set the loading status of button, Default: false"
+  },
+  "qm-button/shape": {
+    "type": "string",
+    "description": "can be set to `circle`, `round` or omitted, Default: -"
+  },
+  "qm-button/size": {
+    "type": "string",
+    "description": "can be set to `small` `large` or omitted, Default: `default`"
+  },
+  "qm-button/type": {
+    "type": "string",
+    "description": "can be set to `primary` `ghost` `dashed` `danger` `link` or omitted (meaning `default`), Default: `default`"
+  },
+  "qm-button/block": {
+    "type": "boolean",
+    "description": "option to fit button width to its parent width, Default: `false`"
+  }
+}

+ 15 - 0
vetur/tags.json

@@ -0,0 +1,15 @@
+{
+  "qm-button": {
+    "attributes": [
+      "disabled",
+      "ghost",
+      "htmlType",
+      "icon",
+      "loading",
+      "shape",
+      "size",
+      "type",
+      "block"
+    ]
+  }
+}