Editor.tsx

import React from 'react';
import {Editor, ShortcutKey} from 'amis-editor';
import {inject, observer} from 'mobx-react';
import {RouteComponentProps} from 'react-router-dom';
import {toast, Select} from 'amis';
import {currentLocale} from 'i18n-runtime';
import {Icon} from '../icons/index';
import {IMainStore} from '../store';
import '../editor/DisabledEditorPlugin'; // 用于隐藏一些不需要的Editor预置组件
import '../renderer/MyRenderer';
import '../editor/MyRenderer';
import axios from 'axios'

let currentIndex = -1;

let host = `${window.location.protocol}//${window.location.host}`;

// 如果在 gh-pages 里面
if (/^\/amis-editor-demo/.test(window.location.pathname)) {
  host += '/amis-editor';
}

const schemaUrl = `${host}/schema.json`;

const editorLanguages = [
  {
    label: '简体中文',
    value: 'zh-CN'
  },
  {
    label: 'English',
    value: 'en-US'
  }
];

export default inject('store')(
  observer(function ({
    store,
    location,
    history,
    match
  }: {store: IMainStore} & RouteComponentProps<{id: string}>) {
    const index: number = parseInt(match.params.id, 10);
    const curLanguage = currentLocale(); // 获取当前语料类型

    // let value= {label: string; icon: string; path: string};
    // store.setAddPageIsOpen(true);
    // store.addPage({
    //   ...value,
    //   schema: {
    //     type: 'page',
    //     title: value.label,
    //     body: '这是你刚刚新增的页面。'
    //   }
    // });
    // store.setAddPageIsOpen(false);


    console.log(index);
    if (index !== currentIndex) {
      currentIndex = index;
      axios({
        method: 'get',
        url: '/api/AmisHandler.ashx?id='+index,
        headers: {
          'Content-Type': 'application/json'
        }
      })
      .then(function (response) {
          console.log(response.data);
          store.updateSchema(response.data);
      });
      //store.updateSchema(store.pages[index].schema);
    }

    function save() {
      axios({
        method: 'post',
        url: '/api/AmisPost.ashx',
        data: {
          id: index,
          schema: store.schema
        }
      });
      //store.updatePageSchemaAt(index);
      toast.success('保存成功', '提示');
    }

    function onChange(value: any) {
      store.updateSchema(value);
      //store.updatePageSchemaAt(index);
    }

    function changeLocale(value: string) {
      localStorage.setItem('suda-i18n-locale', value);
      window.location.reload();
    }

    function exit() {
      //history.push(`/${store.pages[index].path}`);
    }

    return (
      <div className="Editor-Demo">
        <div className="Editor-header">
          <div className="Editor-title">amis 可视化编辑器</div>
          <div className="Editor-view-mode-group-container">
            <div className="Editor-view-mode-group">
              <div
                className={`Editor-view-mode-btn editor-header-icon ${
                  !store.isMobile ? 'is-active' : ''
                }`}
                onClick={() => {
                  store.setIsMobile(false);
                }}
              >
                <Icon icon="pc-preview" title="PC模式" />
              </div>
              <div
                className={`Editor-view-mode-btn editor-header-icon ${
                  store.isMobile ? 'is-active' : ''
                }`}
                onClick={() => {
                  store.setIsMobile(true);
                }}
              >
                <Icon icon="h5-preview" title="移动模式" />
              </div>
            </div>
          </div>

          <div className="Editor-header-actions">
            <ShortcutKey />
            <Select
              className="margin-left-space"
              options={editorLanguages}
              value={curLanguage}
              clearable={false}
              onChange={(e: any) => changeLocale(e.value)}
            />
            <div
              className={`header-action-btn m-1 ${
                store.preview ? 'primary' : ''
              }`}
              onClick={() => {
                store.setPreview(!store.preview);
              }}
            >
              {store.preview ? '编辑' : '预览'}
            </div>
            {!store.preview && (
              <div className={`header-action-btn exit-btn`} onClick={save}>
                保存
              </div>
            )}
          </div>
        </div>
        <div className="Editor-inner">
          <Editor
            theme={'cxd'}
            preview={store.preview}
            isMobile={store.isMobile}
            value={store.schema}
            onChange={onChange}
            onPreview={() => {
              store.setPreview(true);
            }}
            onSave={save}
            className="is-fixed"
            $schemaUrl={schemaUrl}
            showCustomRenderersPanel={true}
            amisEnv={{
              fetcher: store.fetcher,
              notify: store.notify,
              alert: store.alert,
              copy: store.copy
            }}
          />
        </div>
      </div>
    );
  })
);

Flutter
Dart 
Flutter Widget Snippets
https://open-vsx.org/extension/Nash/awesome-flutter-snippets

Fuchsia系统

Dart 是一种面向对象、带垃圾收集的类 C 语言。维基百科的定义是:“Dart 是谷歌开发的一种通用编程语言,后被 Ecma 认定为标准(ECMA-408)。它被用于构建 Web、服务器、桌面和移动应用程序。”

因为 Dart 不仅仅在语言本身,包括它的整个生态圈,都比 JavaScript 落后了一大截。Dart 开发团队转而求其次,在可以被编译成 JavaScript 的同时,Dart 在 2.0 版本中也针对 Web 和移动客户端开发进行了独特优化,从而能让它更好地满足客户端开发人员的需求。

在 Dart 中标识符有三种风格:

大写驼峰:每个单词的第一个字母大写,包括第一个单词。
小写驼峰:每个单词的第一个字母大写,除了 第一个单词一直小写,即使第一个单词是缩写。
小写加下划线:只使用小写字母,即使是缩写,然后使用下划线_分隔。

FlutterGo 目前暂停维护

https://blog.csdn.net/DongShanYuXiao/article/details/131844415
where.exe flutter dart
flutter doctor --android-licenses
flutter doctor

https://flutter.cn/docs/testing/build-modes

 flutter create --project-name my_app --org dev.flutter --android-language java --ios-language objc my_app

 cd my_app


    使用下面指令运行应用:

 flutter run

dart_tool Dart工具开发包
.idea 开发环境配置
android 安卓原生工程文件
build 编译或运行后产物
ios 苹果原生工程文件
lib 包含.dart结尾的工程相关文件,Flutter应用源文件目录
  └──main.dart //flutter入口文件
test 包含.dart结尾的工程测试文件
.gitignore git提交仓库忽略文件
.metadata 一个对当前workspace的配置记录
.packages 以lib结尾的文件绝对路径
flutter_dir.iml 工程文件的本地路径配置
pubspec.lock 前项目依赖所生成的文件
pubspec.yaml 依赖配置,一般用来存放第三方依赖
README.md 自述项目信息(html标签)
External Libraries 安卓架包和资源文件、Dart SDK 文件、工程开发依赖插件API
Scratches and Consoles 创建的临时文件和缓冲区列表


flutter build apk
https://www.cnblogs.com/lovelyun/p/5372251.html
https://www.cnblogs.com/lovelyun/p/5374172.html

create-react-app 跳转页面
https://www.jianshu.com/p/8f2a795c3162
https://www.php.cn/faq/499766.html
https://www.ezd.cc/zs/28448.html

https://react.docschina.org/learn

sql server 2016
https://www.baidu.com/
https://ant.design/index-cn

===================
Chakra UI 和 Material UI

https://chakra-ui.com/getting-started
https://mui.com/material-ui/
========================
现在来看所有的框架只是辅助于开发并不能解决开发出来的东西。也就是无法解决客户的需求。只是一堆的组件。要完成需要那就得开发程序。

https://github.com/facebook/create-react-app  官网开源
https://create-react-app.dev/
https://github.com/facebook/create-react-app/blob/main/packages/cra-template/template/README.md

https://react.dev/

https://create-react-app.dev/docs/adding-a-router

https://3x.ant.design/docs/react/use-with-create-react-app-cn

create-react-app 是业界最优秀的 React 应用开发工具之一,本文会尝试在 create-react-app 创建的工程中使用 antd 组件,并自定义 webpack 的配置以满足各类工程化需求。
yarn create react-app reacterp
# or
# npx create-react-app antd-demo
cd reacterp
yarn start
===================
npx create-react-app my-app
cd my-app
npm start

my-app
├── README.md
├── node_modules
├── package.json
├── .gitignore
├── public
│   ├── favicon.ico
│   ├── index.html
│   └── manifest.json
└── src
    ├── App.css
    ├── App.js
    ├── App.test.js
    ├── index.css
    ├── index.js
    ├── logo.svg
    └── serviceWorker.js
    └── setupTests.js


yarn add react-router-dom
https://www.cnblogs.com/shuhe-nd/p/15703662.html
https://www.cnblogs.com/shuhe-nd/p/15703815.html
React-Router是React生态里面很重要的一环,现在React的单页应用的路由基本都是前端自己管理的,而不像以前是后端路由,React管理路由的库常用的就是就是React-Router。本文想写一下React-Router的使用,但是光介绍API又太平淡了,而且官方文档已经写得很好了,我这里就用一个常见的开发场景来看看React-Router是怎么用的吧。而我们一般的系统都会有用户访问权限的限制,某些页面可能需要用户具有一定的权限才能访问。本文就是用React-Router来实现一个前端鉴权模型。


yarn add axios

https://www.cnblogs.com/shuhe-nd/p/15741383.html

yarn : 无法加载文件 C:\Users\xiexuzhao\AppData\Roaming\npm\yarn.ps1,因为在此系统上禁止运行脚本
set-ExecutionPolicy RemoteSigned


https://chakra-ui.com/getting-started
https://react.docschina.org/learn
https://react.docschina.org/learn/start-a-new-react-project
https://react.docschina.org/learn

最受欢迎的项目:zx、Vite和Next.js

Vite是一个构建工具,可通过esbuild编译器提供出色的性能。Vite最初借助 Vue.js 社区提供支持,但如今Vite已兼容主要UI框架:React、Svelte和Lit。

Next.js排名第三,在React领域依旧保持领先的“元框架”地位。

React 组件是一段可以 使用标签进行扩展 的 JavaScript 函数。
您可能知道最常用的框架之一是Next.js,Netflix、Twitch 或 Uber 等公司通常使用它。它被认为是增长最快的 React 框架之一。其他人很难与 Next.js 竞争
Remix 开源之后可以说是在 React 全栈框架领域激起千层浪,绝对可以算是 Next.js 的强劲对手

Next.js 
Next.js 是一个全栈式的 React 框架。它用途广泛,可以让你创建任意规模的 React 应用——可以是静态博客,也可以是复杂的动态应用。要创建一个新的 Next.js 项目,请在你的终端运行:

 Terminal
 Copy
npx create-next-app@latest


Remix 
Remix 是一个具有嵌套路由的全栈式 React 框架。它可以把你的应用分成嵌套部分,该嵌套部分可以并行加载数据并响应用户操作进行刷新。要创建一个新的 Remix 项目,请运行:

 Terminal
 Copy
npx create-remix

https://transform.tools/html-to-jsx
react-中文网-MSCode微服务平台框架
SpringCloud、SpringBoot、新版工作流、微服务分布式、单体式、低代码/无代码、跨15端、Vue3、Vue2、React、代码生成器、表单设计器、报表设计器、流程设计器、大屏设计器
=======================
同行竞争
https://muqiapp.com/pcv2/html/data/data-index.html
https://www.imhehe.com/about/
https://www.pactera.com/marketinghome?bd_vid=10892003297055120890
https://isite.baidu.com/site/wjzk3e70/63b74c6b-db46-4281-b0a8-c6ee2bb36e5a
https://www.zhanyunsoft.com/?bd_vid=10452030768514793819
https://www.seejoys.com/index.php/Case/apps.html

软著代办一般需要多少钱
中方发布解决巴以冲突的立场文件
拼多多美股市值一度超越阿里
拼多多美股盘中涨超4%,美股市值一度超越阿里巴巴,成为美股市值最大中概股。
APP开发价格多少钱?
根据市场调研数据,一个简单的APP的开发费用大约在20万-50万元人民币之间,中等难度的APP则需要50万元-100万元,而高难度、大规模的APP的开发费用甚至可以达到数百万元。

三大框架并没有解决html从开发到产品的这个过程只不过是三大手段而已。

web.3.0——Web3.0的时代已经来临!
web前端开发框架是在前端工程师中经常会用到的内容,可以大大减少项目中的bug,节约开发成本,加快项目周期。
web前端开发中比较主流的三大框架是:React、Vue和Angular。React是由Facebook推出的一个JavaScript库,主要用于构建用户界面。
Web前端三大主流框架是Vue、React、和Angular。
web前端三大主流框架分别是:Angular、React和Vue.js。
React  Vue 在窗口方面的性能是非常好的。Angular;

https://react.docschina.org/
React 学用这个东西还是有点儿时间的的。
这个东西让界面更组件化开发。有利用于团队合作。但是能也带来了不少的问题。组件就是元素并不是功能。

将 HTML 转化为 JSX 

但是如果你想要动态地指定 src 或 alt 的值呢?你可以 用 { 和 } 替代 " 和 " 以使用 JavaScript 变量 :

export default function Avatar() {
  const avatar = 'https://i.imgur.com/7vQD0fPs.jpg';
  const description = 'Gregorio Y. Zara';
  return (
    <img
      className="avatar"
      src={avatar}
      alt={description}
    />
  );
}

当你写成这样时,你可以很清楚地看到大括号里包着的对象:
<ul style={
  {
    backgroundColor: 'black',
    color: 'pink'
  }
}>

所以当你下次在 JSX 中看到 {{ 和 }}时,就知道它只不过是包在大括号里的一个对象罢了!

陷阱
内联 style 属性 使用驼峰命名法编写。例如,HTML <ul style="background-color: black"> 在你的组件里应该写成 <ul style={{ backgroundColor: 'black' }}>。


根组件文件 
在 你的第一个组件 中,你创建了一个 Profile 组件,并且渲染在 Gallery 组件里。
export default function Gallery() {
function Profile() {
  return (
    <img
      src="https://i.imgur.com/MK3eW3As.jpg"
      alt="Katherine Johnson"
    />
  );
}

在这个示例中,person JavaScript 对象包含 name 中存储的字符串和 theme 对象:

const person = {
  name: 'Gregorio Y. Zara',
  theme: {
    backgroundColor: 'black',
    color: 'pink'
  }
};
该组件可以这样使用来自 person 的值:

<div style={person.theme}>
  <h1>{person.name}'s Todos</h1>
JSX 是一种模板语言的最小实现,因为它允许你通过 JavaScript 来组织数据和逻辑。


ReactDOM 符合 HTML 标准
.

如果 person= 后面的双花括号让你感到困惑,请记住,在 JSX 花括号中,它们只是一个对象。


向组件传递 props 像是 向子组件传递的函数的参数

State:组件的记忆

这就是使用的框架
export default function Button() {
  function handleClick() {
    alert('你点击了我!');
  }

  return (
    <button onClick={handleClick}>
      点我
    </button>
  );
}

import { useState } from 'react';

export default function Form() {
  const [isSent, setIsSent] = useState(false);
  const [message, setMessage] = useState('Hi!');


使用 ref 引用值
这里的 ref 指向一个数字,但是,像 state 一样,你可以让它指向任何东西:字符串、对象,甚至是函数。与 state 不同的是,ref 是一个普通的 JavaScript 对象,具有可以被读取和修改的 current 属性。

请注意,组件不会在每次递增时重新渲染。 与 state 一样,React 会在每次重新渲染之间保留 ref。但是,设置 state 会重新渲染组件,更改 ref 不会!


useRef Hook 返回一个对象,该对象有一个名为 current 的属性。

import { useRef } from 'react';

export default function Form() {
  const inputRef = useRef(null);

  function handleClick() {
    inputRef.current.focus();
  }

  return (
    <>
      <input ref={inputRef} />
      <button onClick={handleClick}>
        聚焦输入框
      </button>
    </>
  );
}


https://react.docschina.org/learn/your-first-component

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值