默认 click 触发子菜单
hover 触发子菜单
```
在xxx\resources\assets\js\app.js
中注册
```
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./bootstrap');
window.Vue = require('vue');
import ElementUI from 'element-ui'
Vue.use(ElementUI);
/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
* or customize the JavaScript scaffolding to fit your unique needs.
*/
Vue.component('example', require('./components/Example.vue'));
const app = new Vue({
el: '#app'
});
```
参照下面这篇文章在phpstorm中将js文件改为es6版本
[链接](https://m.baidu.com/from=1017188c/bd_page_type=1/ssid=0/uid=0/pu=usm%401%2Csz%40320_1001%2Cta%40iphone_2_5.1_3_537/baiduid=3DAD53F62B659E68A50A83F808C0A3FD/w=0_10_/t=iphone/l=3/tc?ref=www_iphone&lid=14183472810423434284&order=1&fm=alop&tj=www_normal_1_0_10_title&vit=osres&m=8&srd=1&cltj=cloud_title&asres=1&title=PhpStorm%E4%B8%AD%E5%9B%A0%E4%B8%BAJS%E7%89%88%E6%9C%AC%E4%BD%8E%E8%80%8C%E6%8F%90%E7%A4%BA%E9%94%99%E8%AF%AF%E7%9A%84%E8%A7%A3%E5%86%B3-Software%2C...&dict=32&w_qd=IlPT2AEptyoA_yipJF3uDywawcNPbHwpy6iLNDhZATmgpF7j4FoHpmmm&sec=21791&di=64d106facc6aab6e&bdenc=1&tch=124.0.19.168.0.0&nsrc=IlPT2AEptyoA_yixCFOxXnANedT62v3IEQGG_yBV1yqhiVizgfulItdnJ7HNQ83NFIibczDXvB9PgyzfQjm&eqid=c4d5d15fb2b34000100000005943190b&wd=&clk_info=%7B%22srcid%22%3A%221599%22%2C%22tplname%22%3A%22www_normal%22%2C%22t%22%3A1497569549884%2C%22sig%22%3A%222838%22%2C%22xpath%22%3A%22div-a-h3%22%7D "链接")
自己去写一条路径,加载css文件
这样去使用就好了
执行编译
>npm run dev
![](https://cos.cc430.cn/2017/06/27/1498549134.png)
效果如下
![](https://cos.cc430.cn/2017/06/16/1497590523.png)