自己建站流程,微信小程序格泰网站建设,wordpress补丁,企业网站托管上一篇#xff1a; vue项目的创建
https://blog.csdn.net/m0_67930426/article/details/134816155
目录
整合过程
使用#xff1a; 整合过程
项目创建完之后#xff0c;使用编译器打开项目
在控制器里输入如下命令 npm install element-ui 如图表示安装完毕
然后在…上一篇 vue项目的创建
https://blog.csdn.net/m0_67930426/article/details/134816155
目录
整合过程
使用 整合过程
项目创建完之后使用编译器打开项目
在控制器里输入如下命令 npm install element-ui 如图表示安装完毕
然后在main.js配置element组件 import ElementUI from element-ui
import element-ui/lib/theme-chalk/index.cssVue.use(ElementUI) element官网
https://element.eleme.cn/#/zh-CN/component/menu 如果对element组件不太熟悉可以进入官网查找想使用的组件
使用
例如我在官网找了一段侧栏的代码 el-menudefault-active2classel-menu-vertical-demoopenhandleOpenclosehandleClosebackground-color#545c64text-color#fffactive-text-color#ffd04bel-submenu index1template slottitlei classel-icon-location/ispan导航一/span/templateel-menu-item-grouptemplate slottitle分组一/templateel-menu-item index1-1选项1/el-menu-itemel-menu-item index1-2选项2/el-menu-item/el-menu-item-groupel-menu-item-group title分组2el-menu-item index1-3选项3/el-menu-item/el-menu-item-groupel-submenu index1-4template slottitle选项4/templateel-menu-item index1-4-1选项1/el-menu-item/el-submenu/el-submenuel-menu-item index2i classel-icon-menu/ispan slottitle导航二/span/el-menu-itemel-menu-item index3 disabledi classel-icon-document/ispan slottitle导航三/span/el-menu-itemel-menu-item index4i classel-icon-setting/ispan slottitle导航四/span/el-menu-item/el-menu
在view中创建一个文件 将上述代码放到该文件中
templateel-menudefault-active2classel-menu-vertical-demoopenhandleOpenclosehandleClosebackground-color#545c64text-color#fffactive-text-color#ffd04bel-submenu index1template slottitlei classel-icon-location/ispan导航一/span/templateel-menu-item-grouptemplate slottitle分组一/templateel-menu-item index1-1选项1/el-menu-itemel-menu-item index1-2选项2/el-menu-item/el-menu-item-groupel-menu-item-group title分组2el-menu-item index1-3选项3/el-menu-item/el-menu-item-groupel-submenu index1-4template slottitle选项4/templateel-menu-item index1-4-1选项1/el-menu-item/el-submenu/el-submenuel-menu-item index2i classel-icon-menu/ispan slottitle导航二/span/el-menu-itemel-menu-item index3 disabledi classel-icon-document/ispan slottitle导航三/span/el-menu-itemel-menu-item index4i classel-icon-setting/ispan slottitle导航四/span/el-menu-item/el-menu/template
script
export default {methods: {handleOpen (key, keyPath) {console.log(key, keyPath)},handleClose (key, keyPath) {console.log(key, keyPath)}}
}
/script
script setup
/script
script setup
/script然后配置该文件的路由 然后运行项目 npm run serve