码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 1.3 vue ui框架-element-ui框架


    1 前言

    ElementUI是一套基于VUE2.0的桌面端组件库,ElementUI提供了丰富的组件帮助开发人员快速构建功能强大、风格统一的页面。

    ElementUI官网 https://element.eleme.io

    2 安装

    运行命令

    cnpm i element-ui -S

    -S表示只在该项目下安装,不是全局安装

    注意:要跳到项目所在目录运行

    会在node_modules文件夹下生成element-ui子目录

    3 应用

    接1.1 创建第一个vue项目-CSDN博客生成的项目。

    3.1 在src/main.js中引入element组件,修改后代码如下:

    1. // The Vue build version to load with the `import` command
    2. // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
    3. import Vue from 'vue'
    4. import App from './App'
    5. import router from './router'
    6. /*引入element组件*/
    7. import ElementUI from 'element-ui';
    8. import 'element-ui/lib/theme-chalk/index.css';
    9. Vue.use(ElementUI);
    10. Vue.config.productionTip = false
    11. /* eslint-disable no-new */
    12. new Vue({
    13. el: '#app',
    14. router,
    15. components: { App },
    16. template: ''
    17. })

    3.2 修改src/components/HelloWorld.vue代码如下

    1. <template>
    2. <div class="hello">
    3. <h1>{{ msg }}</h1>
    4. <el-row>
    5. <el-button>默认按钮</el-button>
    6. <el-button type="primary">主要按钮</el-button>
    7. <el-button type="success">成功按钮</el-button>
    8. <el-button type="info">信息按钮</el-button>
    9. <el-button type="warning">警告按钮</el-button>
    10. <el-button type="danger">危险按钮</el-button>
    11. </el-row>
    12. </div>
    13. </template>
    14. <script>
    15. export default {
    16. name: "HelloWorld",
    17. data() {
    18. return {
    19. msg: "使用element-ui测试",
    20. };
    21. },
    22. };
    23. </script>
    24. <!-- Add "scoped" attribute to limit CSS to this component only -->
    25. <style scoped>
    26. h1,
    27. h2 {
    28. font-weight: normal;
    29. }
    30. ul {
    31. list-style-type: none;
    32. padding: 0;
    33. }
    34. li {
    35. display: inline-block;
    36. margin: 0 10px;
    37. }
    38. a {
    39. color: #42b983;
    40. }
    41. </style>

    3.3 运行效果

    在cmd运行命令npm run dev 然后访问http://localhost:8080,效果如下:

  • 相关阅读:
    基于Go语言Iris+Xorm开发的代码生成器
    容器环境 springcloud gateway grafana prometheus采集集成与问题
    温故知新(十二)——SPI
    孙卫琴的《精通Vue.js》读书笔记-Vue组件的命名规则
    labview卸载重装碰到的问题
    SaaSBase:什么是FlowUs?
    java基础巩固12
    CF1186B
    你真的了解C语言 if - else 、bool(布尔值)、浮点数损失吗 ?
    JAVA计算机毕业设计专辑鉴赏网站Mybatis+系统+数据库+调试部署
  • 原文地址:https://blog.csdn.net/qq_28742901/article/details/136377604
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号