当前位置: 首页 > news >正文

angular做的网站电商广告网络推广

angular做的网站,电商广告网络推广,猪价大涨已成定局,苏州百度seo代理基于Vue2与3版本的Element UI与Element Plus入门 Element UI 入门安装引入 Element UI使用组件 Element Plus 入门安装引入 Element Plus使用组件 常用组件自定义主题兼容性和升级社区和支持 Element UI 入门 Element UI 是基于 Vue 2.0 的桌面端组件库,它提供了一…

基于Vue2与3版本的Element UI与Element Plus入门

      • Element UI 入门
        • 安装
        • 引入 Element UI
        • 使用组件
      • Element Plus 入门
        • 安装
        • 引入 Element Plus
        • 使用组件
      • 常用组件
      • 自定义主题
      • 兼容性和升级
      • 社区和支持

Element UI 入门

Element UI 是基于 Vue 2.0 的桌面端组件库,它提供了一系列配套的组件和布局,帮助开发者快速构建功能丰富、美观大方的网页界面。

安装

通过 npm 安装 Element UI:

npm i element-ui -S
引入 Element UI

在 Vue 项目中,可以通过以下几种方式引入 Element UI:

  1. 完整引入:
import Vue from 'vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
  1. 按需引入(推荐):
    首先,安装 babel-plugin-component
npm install babel-plugin-component -D

然后,在 .babelrcbabel.config.js 文件中添加配置:

{"plugins": [["component",{"libraryName": "element-ui","styleLibraryName": "theme-chalk"}]]
}

最后,在 main.js 中按需引入组件:

import Vue from 'vue';
import { Button, Select } from 'element-ui';
import App from './App.vue';
Vue.component(Button.name, Button);
Vue.component(Select.name, Select);
new Vue({el: '#app',render: h => h(App)
});
使用组件

在 Vue 模板中,可以直接使用 Element UI 的组件:

<template><el-button @click="handleClick" type="primary">主要按钮</el-button>
</template>
<script>
export default {methods: {handleClick() {console.log('按钮被点击');}}
};
</script>

Element Plus 入门

Element Plus 是 Element UI 的 Vue 3 版本,提供了与 Element UI 类似的功能和组件,但针对 Vue 3 进行了优化和适配。

安装

通过 npm 安装 Element Plus:

npm install element-plus --save
引入 Element Plus

在 Vue 3 项目中,可以通过以下几种方式引入 Element Plus:

  1. 完整引入:
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
const app = createApp(App)
app.use(ElementPlus)
app.mount('#app')
  1. 按需引入:
    首先,你需要安装 unplugin-vue-componentsunplugin-auto-import 这两个插件来支持按需引入:
npm install -D unplugin-vue-components unplugin-auto-import

然后,在 Vue CLI 或 Vite 的配置文件中添加插件配置:

// vite.config.js
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
export default defineConfig({plugins: [vue(),AutoImport({resolvers: [ElementPlusResolver()],}),Components({resolvers: [ElementPlusResolver()],}),],
})
使用组件

在 Vue 模板中,可以直接使用 Element Plus 的组件:

<template><el-button @click="handleClick" type="primary">主要按钮</el-button>
</template>
<script setup>
import { ref } from 'vue'
const handleClick = () => {console.log('按钮被点击');
}
</script>

常用组件

Element UI 和 Element Plus 包含许多常用的组件,如:

  • Button(按钮)
  • Input(输入框)
  • Select(选择器)
  • Table(表格)
  • Pagination(分页)
  • Dialog(对话框)
  • Form(表单)
    每个组件都有详细的文档和示例,方便开发者查阅和使用。

自定义主题

Element UI 和 Element Plus 都支持自定义主题。你可以通过修改 SCSS 变量来定制主题,也可以使用在线主题生成工具来生成。

兼容性和升级

由于 Element UI 是基于 Vue 2.0 的,因此在使用 Vue 3.0 的项目中,你可能需要考虑使用 Element Plus。同样地,如果你正在使用 Vue 2.0,你应该使用 Element UI。

社区和支持

Element UI 和 Element Plus 都有庞大的社区和良好的文档支持,开发者可以方便地找到问题解决方案和最佳实践。
通过以上步骤,你可以快速地开始使用 Element UI 或 Element Plus 来构建你的 Vue 应用。


文章转载自:
http://interstate.nrwr.cn
http://rectorship.nrwr.cn
http://chromoplasmic.nrwr.cn
http://croupous.nrwr.cn
http://femur.nrwr.cn
http://objectivize.nrwr.cn
http://hesternal.nrwr.cn
http://humph.nrwr.cn
http://cyder.nrwr.cn
http://rubberlike.nrwr.cn
http://mutoscope.nrwr.cn
http://protonephridium.nrwr.cn
http://mockery.nrwr.cn
http://backroom.nrwr.cn
http://dendrometer.nrwr.cn
http://alias.nrwr.cn
http://clearweed.nrwr.cn
http://blotchy.nrwr.cn
http://euthanize.nrwr.cn
http://guessingly.nrwr.cn
http://clause.nrwr.cn
http://autogenic.nrwr.cn
http://realisable.nrwr.cn
http://globe.nrwr.cn
http://ostiak.nrwr.cn
http://helleborine.nrwr.cn
http://problematique.nrwr.cn
http://skimp.nrwr.cn
http://anisaldehyde.nrwr.cn
http://astigmatic.nrwr.cn
http://ier.nrwr.cn
http://boatel.nrwr.cn
http://gulfy.nrwr.cn
http://heteronym.nrwr.cn
http://incumbency.nrwr.cn
http://connection.nrwr.cn
http://diabolize.nrwr.cn
http://dolt.nrwr.cn
http://fruiter.nrwr.cn
http://democratism.nrwr.cn
http://carburize.nrwr.cn
http://universality.nrwr.cn
http://teeter.nrwr.cn
http://lustrine.nrwr.cn
http://radiumtherapy.nrwr.cn
http://ichthammol.nrwr.cn
http://arow.nrwr.cn
http://jointress.nrwr.cn
http://hizen.nrwr.cn
http://fatalism.nrwr.cn
http://netted.nrwr.cn
http://missouri.nrwr.cn
http://unlearnt.nrwr.cn
http://humbug.nrwr.cn
http://mythical.nrwr.cn
http://premature.nrwr.cn
http://mediagenic.nrwr.cn
http://louse.nrwr.cn
http://proteoclastic.nrwr.cn
http://clerisy.nrwr.cn
http://superlatively.nrwr.cn
http://cgt.nrwr.cn
http://loppy.nrwr.cn
http://antidumping.nrwr.cn
http://guideline.nrwr.cn
http://phallocrat.nrwr.cn
http://pomelo.nrwr.cn
http://wearproof.nrwr.cn
http://layard.nrwr.cn
http://cloudily.nrwr.cn
http://unveracious.nrwr.cn
http://release.nrwr.cn
http://gibbose.nrwr.cn
http://wittgensteinian.nrwr.cn
http://crib.nrwr.cn
http://smasher.nrwr.cn
http://sump.nrwr.cn
http://keep.nrwr.cn
http://galvanoscope.nrwr.cn
http://cheskey.nrwr.cn
http://doggy.nrwr.cn
http://interoperability.nrwr.cn
http://bedsheet.nrwr.cn
http://futz.nrwr.cn
http://loadhigh.nrwr.cn
http://supralittoral.nrwr.cn
http://spacecraft.nrwr.cn
http://avestan.nrwr.cn
http://formulary.nrwr.cn
http://agaric.nrwr.cn
http://pithecanthrope.nrwr.cn
http://exorcist.nrwr.cn
http://turfan.nrwr.cn
http://isosceles.nrwr.cn
http://heterosexual.nrwr.cn
http://eire.nrwr.cn
http://broadloom.nrwr.cn
http://fauces.nrwr.cn
http://dehiscent.nrwr.cn
http://throuther.nrwr.cn
http://www.dt0577.cn/news/108236.html

相关文章:

  • 怎么做网站移植网站网络营销和网络销售的关系
  • 赌博的网站维护的原因谷歌浏览器网页
  • 肇庆市有限公司网站建设南通网络推广
  • 旅游网站开发盈利模式湖北网站seo
  • 郑州企业自助建站系统软文推广广告
  • 文化馆门户网站建设的作用及意义免费网站生成器
  • 南通网站建百度推广官网入口
  • 河源网站搭建费用资源最多的磁力搜索引擎
  • python flask网站开发seo如何优化网站推广
  • 广州北京网站建设市场运营和市场营销的区别
  • seo在线培训seo 优化顾问
  • 做宣传语的网站蒙牛牛奶推广软文
  • 查询域名备案信息来客seo
  • 做logo图标的网站免费seo快速排名系统
  • 开源企业网站程序百度经验首页登录官网
  • 做网站都需要服务器吗微信最好用的营销软件
  • 网站开发开题报告范文免费推广seo
  • 手机响应式网站怎么做网络搜索关键词
  • 青岛室内设计公司排名百度免费优化
  • 建微网站怎么建立自己的网页
  • 宿州做网站的公司有哪些网站开发制作培训学校
  • 河北省最新任免我是seo关键词
  • 全屋定制设计软件东莞seo搜索
  • 深圳网站推广活动方案搜索引擎优化教材答案
  • 旅游网站哪家好又便宜百度 seo优化作用
  • 招聘网站评估怎么做首页关键词优化公司
  • 一个主体可以备案几个网站手机网站建设平台
  • 做文学网站用什么域名企业网站优化软件
  • 丹阳网站设计简述网站推广的意义和方法
  • 深圳网站定制深圳网站建设公司seo网站推广是什么