webstorm 提示找不到 element-plus 但可正常使用?

发布于 2022-09-13 01:27:27 字数 1317 浏览 25 评论 0

这是我的使用场景, 使用效果无影响

<template>
  <div class="about">
    <h1>This is an about page</h1>
    <el-button>默认按钮</el-button>
    <el-button type="primary">主要按钮</el-button>
    <el-button type="success">成功按钮</el-button>
    <el-button type="info">信息按钮</el-button>
    <el-button type="warning">警告按钮</el-button>
    <el-button type="danger">危险按钮</el-button>
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import { ElButton } from "element-plus";

export default defineComponent({
  name: "app",
  components: {
    ElButton
  }
});
</script>

引用报错

package.json

  "name": "vue3-ts-cms",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "prettier": "prettier --write .",
    "prepare": "husky install",
    "commit": "cz"
  },
  "dependencies": {
    "axios": "^0.21.1",
    "core-js": "^3.6.5",
    "element-plus": "^1.1.0-beta.11",
    "normalize.css": "^8.0.1",
    "vue": "^3.0.0",
    "vue-router": "^4.0.10",
    "vuex": "^4.0.2"
  },

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

云淡月浅 2022-09-20 01:27:27

仓库没有正确定义的 index.d.ts 吧,WebStorm 不知道里面是什么内容,但是执行时没问题。

可以试试在 WebStorm > JS library 里下载一个。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文