Closed duolabmeng6 closed 1 month ago
👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.
Please review the labels and make any necessary changes.
npm i --legacy-peer-deps
npm i amis-formula
解决了 不要太坑...
跑起来了 没样式...我也不会用 懵逼了
import {render as renderAmis} from 'amis';
import axios from 'axios';
import '../node_modules/amis/lib/themes/cxd.css';
import '../node_modules/amis/lib/helper.css';
import '../node_modules/amis/sdk/iconfont.css';
function App() {
return (
<div>
{
renderAmis(
{
"type": "page",
"body": [
{
"type": "crud",
"syncLocation": false,
"api": {
"method": "get",
"url": "/api/articles"
},
"columns": [
{
"name": "id",
"label": "ID",
"type": "text"
},
{
"name": "title",
"label": "标题",
"type": "text"
},
{
"type": "datetime",
"label": "创建时间",
"name": "created_at"
},
{
"type": "operation",
"label": "操作",
"buttons": [
{
"label": "编辑",
"type": "button",
"level": "link",
"actionType": "drawer",
"drawer": {
"position": "right",
"size": "lg",
"title": "编辑",
"body": {
"type": "form",
"initApi": "/api/articles/${id}/edit",
"api": "put:/api/articles/${id}",
"body": [
{
"name": "title",
"label": "标题",
"type": "input-text"
},
{
"type": "input-rich-text",
"name": "content",
"label": "内容"
}
]
}
}
},
{
"label": "查看",
"type": "button",
"actionType": "dialog",
"level": "link",
"dialog": {
"title": "查看详情",
"body": {
"type": "form",
"initApi": "/api/articles/${id}/edit",
"body": [
{
"name": "id",
"label": "ID",
"type": "static"
},
{
"name": "title",
"label": "标题",
"type": "static"
},
{
"type": "input-rich-text",
"name": "content",
"label": "内容"
}
]
}
}
},
{
"type": "button",
"label": "删除",
"actionType": "ajax",
"level": "link",
"className": "text-danger",
"confirmText": "确定要删除?",
"api": "delete:/api/articles/${id}"
}
]
}
],
"bulkActions": [
{
"type": "button",
"level": "danger",
"label": "批量删除",
"confirmText": "确定要删除?",
"actionType": "ajax",
"api": "delete:/api/articles/bulkDelete/${ids|raw}",
}
],
"itemActions": [],
"features": [
"create",
"filter",
"bulkDelete",
"update",
"view",
"delete"
],
"filterColumnCount": 3,
"headerToolbar": [
{
"label": "新增",
"type": "button",
"level": "primary",
"actionType": "drawer",
"drawer": {
"position": "right",
"size": "lg",
"title": "新增",
"body": {
"type": "form",
"api": "post:/api/articles",
"body": [
{
"type": "input-text",
"name": "title",
"label": "标题"
},
{
"type": "input-rich-text",
"name": "content",
"label": "内容"
}
]
}
}
},
"bulkActions"
],
"id": "u:c3167575b83d",
"perPageAvailable": [
10
],
"messages": {},
"filter": {
"title": "查询条件",
"body": [
{
"type": "input-text",
"name": "keywords",
"label": "关键字"
}
]
}
}
]
},{
},{theme:"cxd"}
)
}
</div>
)
}
export default App
factory.js:139 Please implement isCancel. see https://baidu.gitee.io/amis/docs/start/getting-started#%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97
不知道啥意思...不会用...样式出来了 事件都没效果 点击都没效果~~
必须要实现那3个接口 fetcher isCancel copy
amis安裝1.x版本的可以
amis安裝1.x版本的可以
成功显示了
不过 点击 新增啊 没翻译 点击搜索 没看到附带参数
react_devtools_backend.js:4026 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of QuickEditComponent2 which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node
必须要实现那3个接口 fetcher isCancel copy
Are they installed?
Failed to resolve import "amis/lib/components/Toast" from "src/App.tsx". Does the file exist?
跟着demo代码复制...也有很多问题
React 中引入 amis 的组件 在 React 环境下使用 amis,还可以直接引入 amis 内置组件,在 amis 项目源码 src/components 下的组件都是标准 React 组件,可以在项目中直接引用,这样就能将 amis 当成纯粹 UI 库来使用。
import {Button} from 'amis/lib/components/index';
<Button
onClick={() => {}}
type="button"
level="link"
className="navbar-btn"
>
按钮
</Button>
https://aisuda.bce.baidu.com/amis/zh-CN/docs/extend/ui-library
这个也引用失败..
搜索功能发起的请求 没有参数
正常情况下 html 下引入sdk是正常的...
react18 不行~不知道怎么解决
用 amis-react-starter 跑demo是没问题的..用最新的脚手架搭建就有问题...~~
请问这个问题解决了吗? 我现在也是启项目 react18 的初始化 amis-editor 各种报错
请问这个问题解决了吗? 我现在也是启项目 react18 的初始化 amis-editor 各种报错
然后我把 react18 降级成了 react16 就可以了,不过会有 findDOMNode is deprecated in StrictMode. findDOMNode 的 warn 请问这个 warn 怎么处理掉?