Package Exports
- element-react
- element-react/dist/npm/es5/src/switch
- element-react/next
- element-react/src/locale/lang/fr
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (element-react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Element React
Element was initially written in Vue, which has many elegant UI components, but we also love React, so we forked it for the React community.
Getting Started
Install
npm install element-react --saveBefore the building, you need a style theme, here we recommend you to pick up element-theme-default.
npm install element-theme-default --saveUsage
We are die hard fans of ECMAScript 6, so we recommend you writing code in modern javascript.
import { Button } from 'element-react';Also we provide an advanced way to tree shaking the code with Rollup.js and Webpack 2
import { Button } from 'element-react/next';Config
With webpack, you need additional loaders to build with element-react.
const webpack = require('webpack');
module.exports = {
entry: {
src: 'path/to/src'
},
output: {
path: 'path/to/output'
publicPath: '/public',
chunkFilename: '[chunkhash:12].js',
filename: '[chunkhash:12].js'
},
plugins: [
new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('production') }),
new webpack.optimize.UglifyJsPlugin({
output: {
comments: false
}
})
],
resolve: {
extensions: ['.js', '.jsx']
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
include: ['path/to/src']
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader']
},
{
test: /\.(ttf|eot|svg|woff|woff2)(\?.+)?$/,
loader: 'file-loader?name=[hash:12].[ext]'
}
]
}
}Contributing
Please make sure to read the Contributing Guide before making a pull request.
Acknowledgments
- @doxiaodong for adding typescript ambient declarations.
Credits
- Element Desktop UI elements for Vue.js 2.0.
License
MIT