{"_id":"3xdata-ace","_rev":"1-c4721220ad476cdc6886ad4d479ab897","name":"3xdata-ace","dist-tags":{"latest":"0.10.0"},"versions":{"0.10.0":{"name":"3xdata-ace","version":"0.10.0","author":{"name":"caiwu"},"description":"A Vue2.0's component based on last ace/brace","keywords":["node.js","javascript","ace","autoComplete","chinese"],"main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{},"license":"GPL","dependencies":{"3xdata-brace":"^0.10.0","emmet":"git+https://github.com/cloud9ide/emmet-core.git#41973fcc70392864c7a469cf5dcd875b88b93d4a"},"__npminstall_done":"Thu May 21 2020 15:45:48 GMT+0800 (中国标准时间)","_from":"vue2-ace-editor-support-chinese@0.0.3","_resolved":"https://registry.npm.taobao.org/vue2-ace-editor-support-chinese/download/vue2-ace-editor-support-chinese-0.0.3.tgz","_id":"3xdata-ace@0.10.0","_nodeVersion":"13.12.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-1/65Wm5SgJlA979vpix3cCPf3wUZXjsj/2MxT/F9VVq622h8jRuu/CWbFdem/vKK1xun3+t2ZOO45dGGsr5VBQ==","shasum":"bdc54acef45af0d8abd2122cf9fe4d6a7f9d3e87","tarball":"https://registry.npmjs.org/3xdata-ace/-/3xdata-ace-0.10.0.tgz","fileCount":4,"unpackedSize":42922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeyzQjCRA9TVsSAnZWagAAwQEP/2Vpc5eaPiIkHflUM9/6\ny0wF9zyxRN1Uln7IlZHp10ngJwcedlIfyjhLLq08R3rMyPZgvJaNuH7MPrkq\nbK74kROZmjlnAtF3VLeEO/Owt+EJ2BnA9O+qScRxZAflqb44zN0rdkOHE1KU\ngoDEQQEDYFJdA0ICVCnfzgWwqUze7ooWIABfQnCqz5HL0V8OjXC0dV9nK7pS\nxW2r+uJ63OHCboOjhOVk9xLDemnhEKlYfLgbUATEHrqjuBgCS1S0WbsiAjhh\n3mtoWLfexGWwCND8aAOunDH4hATcKVe+25YGjw9M1iEu2SppGZKOqkdE6Wsk\nA2qj9YZup+mmhaXc1Sjb9Yx1AruiazTQ6aXsQnE6F9hfyjJZz9upyTb1+WCr\nkvzpK4AEehE+U5yBgX8vvTOxQQifxL4+7S89wFWrOI7o7qDxoisDWsWhpz2I\nOmbHK0o+pMNm00/2aBF3qF9JEkRi/GbBBrH7LIiSESCLfphMeDroJMW/zDzM\nrGzs6nYko9Cjh8r7wQImwfN+gXM0zesfChD/YA/mxU06I6bGchsrfC/VzvHp\nsCUgbl2qo1BUJncfVyon4iJ30mB4gTcJ4v8yAmj2KFij9X8YM19bXHH95mNi\nVaFVoA8yudd0Lgk7xfl1AvueLczHPXTjtnxpQrc4ut6q2xjywvrspFWrz4zr\nUAbN\r\n=wLhI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBpkY7jm5HArstrLRcXfH2FPuXZ5SGkVQ2ILLMUUPycYAiEAu3JbmHmqsAZYfNJ5LsSOVF72B1kT2ii1BTUA6ruWlos="}]},"maintainers":[{"name":"caiwu","email":"2252711582@qq.com"}],"_npmUser":{"name":"caiwu","email":"2252711582@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/3xdata-ace_0.10.0_1590375459042_0.6347107694173135"},"_hasShrinkwrap":false}},"time":{"created":"2020-05-25T02:57:39.041Z","0.10.0":"2020-05-25T02:57:39.153Z","modified":"2022-04-04T10:21:56.708Z"},"maintainers":[{"name":"caiwu","email":"2252711582@qq.com"}],"description":"A Vue2.0's component based on last ace/brace","keywords":["node.js","javascript","ace","autoComplete","chinese"],"repository":{},"author":{"name":"caiwu"},"license":"GPL","readme":"# vue2-ace-editor-support-chinese ![](https://img.shields.io/badge/vue-v2.0-green.svg) ![](https://img.shields.io/badge/license-GPL%20license-blue.svg)\r\n\r\nA packaging of [ace](https://ace.c9.io/) support chinese, and support autocomplete.\r\n\r\n基于ace、vue2的支持中文的组件包\r\n\r\n支持自动补全功能\r\n\r\n## How to use（如何使用）\r\n\r\n1. Install\r\n\r\n    ```\r\n    npm install --save-dev vue2-ace-editor-support-chinese\r\n    ```\r\n    \r\n2. Require it in `components` of Vue options（推荐使用 ES6 写法）\r\n\r\n    ```\r\n    import editor from \"vue2-ace-editor-support-chinese\";\r\n\r\n    export default {\r\n        data(){\r\n              return {}\r\n        },\r\n        methods,\r\n        ...\r\n        components: { editor },\r\n    }\r\n    ```\r\n \r\n3. Require the editor's mode/theme module in custom methods\r\n    \r\n    ```\r\n    {\r\n        data,\r\n        methods:{\r\n            editorInit:function () {\r\n                // 这里需要哪种语言就引用那种，需要那个主题就用哪个。\r\n                // Import which one you want.\r\n                require('brace/mode/javascript');\r\n                require('brace/theme/github');\r\n            }\r\n        },\r\n    }\r\n    ```\r\n    \r\n4. Use the component in template（以下是两种不同使用方法）\r\n\r\n    * Direct use of v-model binding variables;（直接使用 v-model 绑定变量）\r\n        ```\r\n        <editor v-model=\"content\" \r\n            @init=\"editorInit();\"\r\n            :autoComplete=true\r\n            @setCompletions=\"setCompletions\"\r\n            lang=\"html\" theme=\"chrome\" width=\"500\" height=\"100\"></editor>\r\n        ```\r\n        \r\n        prop `v-model`  is required（v-model必须）\r\n        \r\n        prop `lang` and `theme` is same as [ace-editor's doc](https://github.com/ajaxorg/ace)\r\n        \r\n        prop `height` and `width` could be one of these:  `200`, `200px`, `50%`\r\n        \r\n        prop `autoComplete` can define whether autoComplete is enabled（此标志定义自动提示，是否开启）\r\n        \r\n        prop `setCompletions` autoComplete callback（自动提示回调函数，在编辑器内容变化时触发，参数有四个） \r\n    \r\n    * Separate value and input separately;（分别指定input 和 value）\r\n        ```\r\n        <editor @init=\"editorInit();\" \r\n                @input=\"changeData\"\r\n                @setCompletions=\"setCompletions\"\r\n                :autoComplete=true \r\n                :value='editData'\r\n                lang=\"html\" theme=\"chrome\" width=\"500\" height=\"100\"></editor>\r\n\r\n        {\r\n            data(){\r\n              return {\r\n                editData: editData //初始展示数据，必要时三目运算判空\r\n              }\r\n            },\r\n            methods: {\r\n                // value变化触发input执行，\r\n                changeData: function (context) {\r\n                  this.editData = context;\r\n                },\r\n              \r\n                /**\r\n                 * 设置自动补全回调函数，value变化实时执行。\r\n                 * @param editor ace editor对象\r\n                 * @param session\r\n                 * @param pos 当前字符位置：row、column\r\n                 * @param prefix 当前编辑字符\r\n                 * @param callback 执行函数\r\n                 */\r\n                setCompletions (editor, session, pos, prefix, callback) {\r\n                  let wordList = ['提示']\r\n                  callback(null, wordList.map(function (word) {\r\n                    return {\r\n                      caption: word,\r\n                      value: word,\r\n                      meta: 'local'\r\n                    }\r\n                  }))\r\n                }\r\n            }\r\n        }\r\n        ```\r\n        \r\n        prop `@input` `:value` is required（必须）\r\n        \r\n        prop `lang` and `theme` is same as [ace-editor's doc](https://github.com/ajaxorg/ace)\r\n        \r\n        prop `height` and `width` could be one of these:  `200`, `200px`, `50%`\r\n        \r\n        prop `autoComplete` can define whether autoComplete is enabled（此标志定义自动提示，是否开启）\r\n        \r\n        prop `setCompletions` autoComplete callback（自动提示回调函数，在编辑器内容变化时触发，参数有四个） \r\n\r\n## License\r\n[GPL许可证](http://www.gnu.org/licenses/gpl.html)","readmeFilename":"README.md"}