提交 594c3e797674d215bd60b8c9e39c79f297687b2b

作者 Yu
提交者 chencheng (云谦)
1 个父辈 49e0cc0b

feat: add demo with dependencies (#27)

  1 +export default {
  2 + plugins: [
  3 + ['umi-plugin-block-dev', {
  4 + layout: 'ant-design-pro',
  5 + }],
  6 + ['umi-plugin-react', {
  7 + antd: true,
  8 + }],
  9 + ],
  10 +}
... ...
  1 +{
  2 + "name": "@umi-blocks/demo-with-dependencies",
  3 + "description": "a demo block with dependencies",
  4 + "scripts": {
  5 + "dev": "umi dev"
  6 + },
  7 + "dependencies": {
  8 + "antd": "^3.10.9"
  9 + },
  10 + "devDependencies": {
  11 + "umi": "^2.3.0",
  12 + "umi-plugin-react": "^1.3.0",
  13 + "umi-plugin-block-dev": "^1.0.0"
  14 + },
  15 + "blockConfig": {
  16 + "dependencies": ["demo"]
  17 + }
  18 +}
... ...
  1 +import React from 'react';
  2 +import { Row, Col } from 'antd';
  3 +import Demo from './Demo';
  4 +import styles from './index.less';
  5 +
  6 +export default () => {
  7 + return (
  8 + <div className={styles.container}>
  9 + <Row><Col span={24}>I am a block with dependencies.</Col></Row>
  10 + <Row>
  11 + <Col span={12}><Demo /></Col>
  12 + <Col span={12}><Demo /></Col>
  13 + </Row>
  14 + </div>
  15 + )
  16 +}
... ...
  1 +.container {
  2 + color: red;
  3 +}
\ No newline at end of file
... ...
1   -import styles from './index.less';
2 1 import React from 'react';
3 2 import { Button } from 'antd';
  3 +import styles from './index.less';
4 4
5 5 export default () => {
6 6 return <Button className={styles.container}>Hello UmiJS!</Button>
... ...
注册登录 后发表评论