vue封装element 中table组件

1、知识点

插槽
组件

2、项目初始化

  • 使用vue-cli3 安装项目 vue create ‘项目名’
  • npm install element-ui -s

3、父组件 List.vue






4、子组件 CommonTable.vue






5、项目入口 main.js

import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

6、总结


github项目地址
https://github.com/shangliaoy...

你可能感兴趣的:(vue.js)