小编dav*_*nci的帖子

如何从language_tools外部在react ace编辑器中添加自定义完成器

如何使用 addCompleter 或 setCompleter 等函数从 index.js 在基于 React 的 ace 编辑器中添加自定义完成器

import { render } from "react-dom";
import AceEditor from "../src/ace";
import "brace/mode/jsx";
import 'brace/mode/HCPCustomCalcs'
import 'brace/theme/monokai'
import "brace/snippets/HCPCustomCalcs";
import "brace/ext/language_tools";
const defaultValue = `function onLoad(editor) {
  console.log("i've loaded");
}`;
class App extends Component {

  constructor(props, context) {
    super(props, context);
    this.onChange = this.onChange.bind(this);
}
onChange(newValue) {
    console.log('changes:', newValue);
}
  render() {

      return (
          <div>
              <AceEditor
                  mode="HCPCustomCalcs"
                  theme="monokai"
                  width={ '100%' }
                  height={ '100vh' }
                  onChange={this.onChange}
                  name="UNIQUE_ID_OF_DIV"
                  editorProps={{
                      $blockScrolling: true
                  }}
                  enableBasicAutocompletion={true} …
Run Code Online (Sandbox Code Playgroud)

ace-editor react-ace

3
推荐指数
1
解决办法
1572
查看次数

使用 C++ STL 实现数组

我试过这两个无法理解的区别

     vector<int >a(n) and vector<int >a[n]
Run Code Online (Sandbox Code Playgroud)

请有人解释。谢谢

c++ stl

-7
推荐指数
1
解决办法
168
查看次数

标签 统计

ace-editor ×1

c++ ×1

react-ace ×1

stl ×1