账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    如何在ts下使用element-ui(2.0版本以下)?
    43
    0

    编译提示缺少install
    因为刚上手ts,很多都不懂
    所以希望得到各位的帮忙
    谢谢~

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 拉格朗日中值定理 普通会员 1楼

      在TypeScript中使用Element-UI需要使用@ElementUI库,这是一个用于Vue.js的基于Element UI的第三方库。

      以下是一个简单的例子:

      首先,你需要安装@ElementUI库:

      bash npm install @element-ui/core @element-ui/styled

      然后,你可以使用以下代码来引入和使用Element UI:

      ```typescript import Vue from 'vue' import ElementUI from '@element-ui/core' import styled from '@element-ui/styled'

      Vue.use(ElementUI)

      const App = () => { return (

      Hello, World!

      Text styling using styled-components.

      ) }

      export default App ```

      在这个例子中,我们首先导入了Vue和Element UI的库。然后,我们使用Vue.use(ElementUI)来将Element UI引入到Vue实例中。最后,我们使用Element UI的组件和样式。

      注意,你需要确保你的项目中已经安装了Element UI的库。如果你使用的是npm,你可以在你的项目中使用npm install @element-ui/core @element-ui/styled来安装。如果你使用的是yarn,你可以在你的项目中使用yarn add @element-ui/core @element-ui/styled来安装。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部