ice icon indicating copy to clipboard operation
ice copied to clipboard

import { store as appStore } from 'ice'; 导入报错,官方示例也报错

Open GPWiOS opened this issue 6 years ago • 2 comments

问题描述

代码示例

import { store as appStore } from 'ice';

const UserInfo = () => {
  const [userInfo, userActions] = appStore.useModel('user');
  useEffect(() => {
    userActions.fetchUserProfile();
  }, []);
  return (
    <Card free>
      <Card.Header title="状态管理 - 全局状态" />
      <Card.Divider />
      <Card.Content>
        <Avatar size="small" src={userInfo.avatar} />
        <span
          style={{
            marginLeft: 10,
          }}
        >
          {userInfo.name}
        </span>
      </Card.Content>
    </Card>
  );
};

export default UserInfo;

packege.json

{ "name": "@icedesign/stark-child-scaffold", "version": "3.0.5", "description": "微前端方案 icestark 的子应用模板,用于快速初始化微应用", "dependencies": { "@alifd/next": "^1.x", "@alifd/theme-design-pro": "^0.x", "@icedesign/container": "^1.0.4", "@types/react": "^16.9.20", "@types/react-dom": "^16.9.5", "axios": "^0.17.1", "moment": "^2.24.0", "react": "^16.6.0", "react-dom": "^16.6.0" }, "devDependencies": { "@ice/spec": "^1.0.0", "build-plugin-fusion": "^0.1.0", "build-plugin-icestark": "^1.0.2", "build-plugin-moment-locales": "^0.1.0", "eslint": "^6.0.1", "ice.js": "^1.0.0", "stylelint": "^13.0.0" }, "scripts": { "start": "icejs start", "build": "icejs build", "lint": "npm run eslint && npm run stylelint", "eslint": "eslint --cache --ext .js,.jsx ./", "stylelint": "stylelint ./**/*.scss" }, "engines": { "node": ">=8.0.0" }, "iceworks": { "type": "react", "adapter": "adapter-react-v3" }, "ideMode": { "name": "ice-react" }, "repository": { "type": "git", "url": "https://github.com/alibaba-fusion/materials/tree/master/scaffolds/ice-stark-child" }, "private": true, "originTemplate": "@icedesign/stark-child-scaffold" }

chrome console 面板错误信息

image

GPWiOS avatar Mar 30 '20 05:03 GPWiOS

@GPWiOS 今天发布版本解决

chenbin92 avatar Mar 30 '20 06:03 chenbin92

@GPWiOS 已发布 [email protected] 版本修复

chenbin92 avatar Mar 30 '20 09:03 chenbin92