# 组件化
# Web Components
# lib
- Vue2 (opens new window)
- Vue3 (opens new window)
- React (opens new window)
- Angular (opens new window)
- x-tag (opens new window)
- Polymer (opens new window)
# webpack
function importAll(requireContext) {
requireContext.keys().forEach(path => {
let component = requireContext(path)
component = component.default || component
Vue.component(component.name, component)
})
}
const requireContextFilter = require.context('./filter', false, /\.vue$/)
const requireContextComponents = require.context('./components', false, /\.vue$/)
importAll(requireContextFilter)
importAll(requireContextComponents)
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12