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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -6,6 +6,8 @@
/*! ../wxs/utils */
/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! @antmjs/vantui/es/sidebar */
/*! @antmjs/vantui/es/sidebar-item */

View File

@@ -10,7 +10,6 @@
!*** css ./node_modules/cache-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[2]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[3]!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[5]!./src/pages/mountainPeak/index.scss ***!
\************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
.peakContent {
background-color: yellow;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;

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>
);