feat: 富文本-内容CMS

This commit is contained in:
eric
2022-11-13 19:20:15 +08:00
parent 70e6a45d06
commit 125591ebae
7 changed files with 32 additions and 16 deletions

View File

@@ -36,7 +36,8 @@ const Home = () => {
console.log("res", res);
},
}
getTable(objParams)
getTableid(objParams);
}, []);

View File

@@ -1,5 +1,5 @@
.peakContent{
background-color: yellow;
// background-color: yellow;
display: flex;
flex-direction: row;
}

View File

@@ -1,11 +1,11 @@
import { RichText, View } from "@tarojs/components";
import react from "react";
import react, { useEffect, useState } from "react";
import { Sidebar, SidebarItem } from "@antmjs/vantui";
import "./index.scss";
import {test} from '../../utils/index'
import { getTable } from "../../utils/index";
const mountainPeak = () => {
const [dataSource, setdataSource] = useState<any>([]);
const state: any = {
nodes: [
{
@@ -23,9 +23,23 @@ const mountainPeak = () => {
},
],
};
useEffect(() => {
let objParams2 = {
tableName: "cityNew",
id: "80516fb66370bcf300b8f43c5f4dd52b",
okFun: (res) => {
console.log("res", res);
setdataSource(res?.data ?? []);
},
};
// getTable(objParams)
getTable(objParams2);
}, []);
return (
<View className={`peakContent`}>
{" "}
{/* 边栏 */}
<Sidebar activeKey={0}>
<SidebarItem title="梧桐山" />
<SidebarItem title="梧桐山" />
@@ -35,14 +49,14 @@ const mountainPeak = () => {
<SidebarItem title="梧桐山" />
<SidebarItem title="梧桐山" />
<SidebarItem title="梧桐山" />
<SidebarItem title="标签名" />
<SidebarItem title="标签名" />
<SidebarItem title="梧桐山" />
<SidebarItem title="梧桐山" />
</Sidebar>
<View onClick={()=>{
test()
}}>
{" "}
<RichText nodes={state.nodes} />
{/* 富文本 */}
<View onClick={() => {}}>
<View>{dataSource?.[0]?.actTitle}</View>
<RichText nodes={dataSource?.[0]?.richText} />
</View>
</View>
);