We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
以Alert为例,
element-ui
el-alert
src
index.js
src/index.js
export { default as Alert } from './alert'; // 注册Alert组件
src/alert/index.js
packages/alert/src/main.vue
import React, { PropTypes } from 'react'; import { Component, View } from '../../libs'; export default class Alert extends Component { render() { // el-alert的<template /> } } Alert.propTypes = { // el-alert的props.type } Alert.defaultProps = { // el-alert的props.default };
demo/pages
style.scss
import './style.scss'; import React from 'react'; import { Alert } from '../../../src'; export default class Playground extends React.Component { render() { return ( <div> <section className="demo-section"> <div className="demo-header"> <h2>Alert 警告</h2> <p>用于页面中展示重要的提示信息。</p> <h3>基本用法</h3> <p>页面中的非浮层元素,不会自动消失。</p> </div> <div className="demo-content demo-alert"> <Alert title="成功提示的文案" type="success" /> <Alert title="消息提示的文案" type="info" /> <Alert title="警告提示的文案" type="warning" /> <Alert title="错误提示的文案" type="error" /> </div> </section> </div> ) } }
.demo-alert { .el-alert { margin-bottom: 20px; } }
demo/pages/index.js
import Alert from './alert'; // pages是有序的Object, 会影响到左侧的菜单顺序. const pages = { alert: { title: 'Alert 警告', component: Alert }, }; class App extends React.Component { constructor(props) { super(props); this.state = { page: 'alert' // Demo的默认页面 }; } }
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: