docs: highlight渲染问题
This commit is contained in:
parent
31592e9989
commit
e69408afca
|
@ -7,8 +7,8 @@
|
|||
<i class='ei-play code-btn' @click='run' title='在线运行'></i>
|
||||
<i class='ei-copy code-btn' @click='copy' title='复制代码'></i>
|
||||
</div>
|
||||
<highlight-code :lang='localLang'>
|
||||
{{localCode}}
|
||||
<highlight-code :code='localCode' ref='highlight' :lang='localLang'>
|
||||
<!-- {{localCode}} -->
|
||||
</highlight-code>
|
||||
<div v-show='html!==""'>
|
||||
<div class='output-title'>运行结果</div>
|
||||
|
@ -17,7 +17,7 @@
|
|||
<i :class='"ei-angle-" +(localFold?"down":"up")'></i>
|
||||
<span class='show-text'>{{localFold?"显示结果":"隐藏结果"}}</span>
|
||||
</div>
|
||||
<div v-show='!localFold' ref='htmlArea'></div>
|
||||
<div v-show='!localFold' v-html='html'></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='powered-by'>
|
||||
|
@ -82,21 +82,18 @@
|
|||
this.localLang = codes[this.id].lang === 'html' ? 'html' : 'javascript';
|
||||
this.localDesc = codes[this.id].desc || this.desc;
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
let js = '';
|
||||
if (this.localLang === 'html') {
|
||||
let res = extractScript(this.localCode);
|
||||
js = res.js;
|
||||
this.html = res.html;
|
||||
this.$refs.htmlArea.innerHTML = res.html;
|
||||
} else {
|
||||
js = this.localCode;
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.$nextTick(() => {
|
||||
event.regist('onlog', this.onLog);
|
||||
execute({code: js});
|
||||
event.remove('onlog', this.onLog);
|
||||
}, 200);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
@ -116,7 +113,6 @@
|
|||
}
|
||||
html += `<div ${attr}>${item}</div>`;
|
||||
});
|
||||
this.$refs.htmlArea.innerHTML += html;
|
||||
this.html += html;
|
||||
},
|
||||
copy () {
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{628:function(t,r,a){"use strict";a.r(r);var n=a(21),s=Object(n.a)({},(function(){var t=this,r=t.$createElement,a=t._self._c||r;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"_1-介绍"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-介绍"}},[t._v("#")]),t._v(" 1. 介绍")]),t._v(" "),a("p",[a("code",[t._v("cnchar-poly")]),t._v(" 库是用于支持多音词的库,该库本身并不提供新的api")]),t._v(" "),a("p",[t._v("引入该库之后,"),a("code",[t._v("cnchar.spell()")]),t._v(" 方法才会支持多音词,否则对于多音字会返回默认读音")]),t._v(" "),a("p",[t._v("npm安装")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("npm i cnchar-poly\n")])])]),a("p",[t._v("cdn使用")]),t._v(" "),a("div",[a("highlight-code",{attrs:{lang:"html"}},[t._v('\n<script src="https://cdn.jsdelivr.net/npm/cnchar-poly/cnchar.poly.min.js"><\/script>\n ')])],1),t._v(" "),a("p",[t._v("使用")]),t._v(" "),a("div",[a("highlight-code",{attrs:{lang:"javascript"}},[t._v("\nimport cnchar from 'cnchar';\nimport poly from 'cnchar-poly';\ncnchar.use(poly); // use 在浏览器环境中非必须\n ")])],1),t._v(" "),a("h2",{attrs:{id:"_2-实例"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-实例"}},[t._v("#")]),t._v(" 2. 实例")]),t._v(" "),a("p",[t._v("以下演示几个多音词的例子")]),t._v(" "),a("p",[a("codebox",{attrs:{id:"poly"}})],1),t._v(" "),a("p",[t._v("由于多音词依赖分词与词库,且cnchar是一个静态的js库,所以可能会有诸多不准确的读音")]),t._v(" "),a("p",[t._v("如果遇到不准缺的多音词,欢迎提"),a("a",{attrs:{href:"https://github.com/theajack/cnchar/issues/new",target:"_blank",rel:"noopener noreferrer"}},[t._v("issue或pr"),a("OutboundLink")],1)])])}),[],!1,null,null,null);r.default=s.exports}}]);
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{622:function(t,r,a){"use strict";a.r(r);var n=a(21),s=Object(n.a)({},(function(){var t=this,r=t.$createElement,a=t._self._c||r;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"_1-介绍"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-介绍"}},[t._v("#")]),t._v(" 1. 介绍")]),t._v(" "),a("p",[a("code",[t._v("cnchar-poly")]),t._v(" 库是用于支持多音词的库,该库本身并不提供新的api")]),t._v(" "),a("p",[t._v("引入该库之后,"),a("code",[t._v("cnchar.spell()")]),t._v(" 方法才会支持多音词,否则对于多音字会返回默认读音")]),t._v(" "),a("p",[t._v("npm安装")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("npm i cnchar-poly\n")])])]),a("p",[t._v("cdn使用")]),t._v(" "),a("div",[a("highlight-code",{attrs:{lang:"html"}},[t._v('\n<script src="https://cdn.jsdelivr.net/npm/cnchar-poly/cnchar.poly.min.js"><\/script>\n ')])],1),t._v(" "),a("p",[t._v("使用")]),t._v(" "),a("div",[a("highlight-code",{attrs:{lang:"javascript"}},[t._v("\nimport cnchar from 'cnchar';\nimport poly from 'cnchar-poly';\ncnchar.use(poly); // use 在浏览器环境中非必须\n ")])],1),t._v(" "),a("h2",{attrs:{id:"_2-实例"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-实例"}},[t._v("#")]),t._v(" 2. 实例")]),t._v(" "),a("p",[t._v("以下演示几个多音词的例子")]),t._v(" "),a("p",[a("codebox",{attrs:{id:"poly"}})],1),t._v(" "),a("p",[t._v("由于多音词依赖分词与词库,且cnchar是一个静态的js库,所以可能会有诸多不准确的读音")]),t._v(" "),a("p",[t._v("如果遇到不准缺的多音词,欢迎提"),a("a",{attrs:{href:"https://github.com/theajack/cnchar/issues/new",target:"_blank",rel:"noopener noreferrer"}},[t._v("issue或pr"),a("OutboundLink")],1)])])}),[],!1,null,null,null);r.default=s.exports}}]);
|
|
@ -1 +1 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{632:function(r,t,n){"use strict";n.r(t);var a=n(21),c=Object(a.a)({},(function(){var r=this,t=r.$createElement,n=r._self._c||t;return n("ContentSlotsDistributor",{attrs:{"slot-key":r.$parent.slotKey}},[n("h2",{attrs:{id:"_1-介绍"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-介绍"}},[r._v("#")]),r._v(" 1. 介绍")]),r._v(" "),n("p",[n("code",[r._v("cnchar-trad")]),r._v(" 库是用于繁体字,除此之外,该库还提供繁体、简体、火星文之间的相互转换")]),r._v(" "),n("p",[r._v("引入该库之后,cnchar的所有api都支持 "),n("code",[r._v("simple")]),r._v("和"),n("code",[r._v("trad")]),r._v("参数,用于只使用简体或繁体,默认两种字体都使用")]),r._v(" "),n("p",[r._v("npm安装")]),r._v(" "),n("div",{staticClass:"language- extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[r._v("npm i cnchar-trad\n")])])]),n("p",[r._v("cdn使用")]),r._v(" "),n("div",[n("highlight-code",{attrs:{lang:"html"}},[r._v('\n<script src="https://cdn.jsdelivr.net/npm/cnchar-trad/cnchar.trad.min.js"><\/script>\n ')])],1),r._v(" "),n("p",[r._v("使用")]),r._v(" "),n("div",[n("highlight-code",{attrs:{lang:"javascript"}},[r._v("\nimport cnchar from 'cnchar';\nimport trad from 'cnchar-trad';\ncnchar.use(trad); // use 在浏览器环境中非必须\n ")])],1),r._v(" "),n("h2",{attrs:{id:"_2-繁体字支持"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-繁体字支持"}},[r._v("#")]),r._v(" 2. 繁体字支持")]),r._v(" "),n("p",[r._v("以下演示几个繁体字支持的例子")]),r._v(" "),n("p",[n("codebox",{attrs:{id:"trad"}})],1),r._v(" "),n("h2",{attrs:{id:"_3-字体转换-convert"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-字体转换-convert"}},[r._v("#")]),r._v(" 3. 字体转换(convert)")]),r._v(" "),n("p",[r._v("引入 cnchar-trad 库之后,在cnchar上会生成一个 "),n("code",[r._v("convert")]),r._v(" 对象,功能是支持字体转换,另外在string.prototype 上也会附加上对应的方法,用法如下:")]),r._v(" "),n("div",[n("highlight-code",{attrs:{lang:"javascript"}},[r._v("\ncnchar.convert.simpleToTrad(string); // 简体 => 繁体\ncnchar.convert.simpleToSpark(string); // 简体 => 火星文\ncnchar.convert.tradToSimple(string); // 繁体 => 简体\ncnchar.convert.tradToSpark(string); // 繁体 => 火星文\ncnchar.convert.sparkToSimple(string); // 火星文 => 简体\ncnchar.convert.sparkToTrad(string); // 火星文 => 繁体\nstring.convertSimpleToTrad();\nstring.convertSimpleToSpark();\nstring.convertTradToSimple();\nstring.convertTradToSpark();\nstring.convertSparkToSimple();\nstring.convertSparkToTrad();\n ")])],1),r._v(" "),n("p",[r._v("以下是几个实例:")]),r._v(" "),n("p",[n("codebox",{attrs:{id:"convert"}})],1)])}),[],!1,null,null,null);t.default=c.exports}}]);
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{630:function(r,t,n){"use strict";n.r(t);var a=n(21),c=Object(a.a)({},(function(){var r=this,t=r.$createElement,n=r._self._c||t;return n("ContentSlotsDistributor",{attrs:{"slot-key":r.$parent.slotKey}},[n("h2",{attrs:{id:"_1-介绍"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-介绍"}},[r._v("#")]),r._v(" 1. 介绍")]),r._v(" "),n("p",[n("code",[r._v("cnchar-trad")]),r._v(" 库是用于繁体字,除此之外,该库还提供繁体、简体、火星文之间的相互转换")]),r._v(" "),n("p",[r._v("引入该库之后,cnchar的所有api都支持 "),n("code",[r._v("simple")]),r._v("和"),n("code",[r._v("trad")]),r._v("参数,用于只使用简体或繁体,默认两种字体都使用")]),r._v(" "),n("p",[r._v("npm安装")]),r._v(" "),n("div",{staticClass:"language- extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[r._v("npm i cnchar-trad\n")])])]),n("p",[r._v("cdn使用")]),r._v(" "),n("div",[n("highlight-code",{attrs:{lang:"html"}},[r._v('\n<script src="https://cdn.jsdelivr.net/npm/cnchar-trad/cnchar.trad.min.js"><\/script>\n ')])],1),r._v(" "),n("p",[r._v("使用")]),r._v(" "),n("div",[n("highlight-code",{attrs:{lang:"javascript"}},[r._v("\nimport cnchar from 'cnchar';\nimport trad from 'cnchar-trad';\ncnchar.use(trad); // use 在浏览器环境中非必须\n ")])],1),r._v(" "),n("h2",{attrs:{id:"_2-繁体字支持"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-繁体字支持"}},[r._v("#")]),r._v(" 2. 繁体字支持")]),r._v(" "),n("p",[r._v("以下演示几个繁体字支持的例子")]),r._v(" "),n("p",[n("codebox",{attrs:{id:"trad"}})],1),r._v(" "),n("h2",{attrs:{id:"_3-字体转换-convert"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-字体转换-convert"}},[r._v("#")]),r._v(" 3. 字体转换(convert)")]),r._v(" "),n("p",[r._v("引入 cnchar-trad 库之后,在cnchar上会生成一个 "),n("code",[r._v("convert")]),r._v(" 对象,功能是支持字体转换,另外在string.prototype 上也会附加上对应的方法,用法如下:")]),r._v(" "),n("div",[n("highlight-code",{attrs:{lang:"javascript"}},[r._v("\ncnchar.convert.simpleToTrad(string); // 简体 => 繁体\ncnchar.convert.simpleToSpark(string); // 简体 => 火星文\ncnchar.convert.tradToSimple(string); // 繁体 => 简体\ncnchar.convert.tradToSpark(string); // 繁体 => 火星文\ncnchar.convert.sparkToSimple(string); // 火星文 => 简体\ncnchar.convert.sparkToTrad(string); // 火星文 => 繁体\nstring.convertSimpleToTrad();\nstring.convertSimpleToSpark();\nstring.convertTradToSimple();\nstring.convertTradToSpark();\nstring.convertSparkToSimple();\nstring.convertSparkToTrad();\n ")])],1),r._v(" "),n("p",[r._v("以下是几个实例:")]),r._v(" "),n("p",[n("codebox",{attrs:{id:"convert"}})],1)])}),[],!1,null,null,null);t.default=c.exports}}]);
|
|
@ -1 +1 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{625:function(r,c,a){"use strict";a.r(c);var n=a(21),t=Object(n.a)({},(function(){var r=this,c=r.$createElement,a=r._self._c||c;return a("ContentSlotsDistributor",{attrs:{"slot-key":r.$parent.slotKey}},[a("h2",{attrs:{id:"_1-npm安装"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-npm安装"}},[r._v("#")]),r._v(" 1. npm安装")]),r._v(" "),a("p",[r._v("cnchar包含了一个基本库和四个功能库,用于实现不同的功能,您可以按需安装其中的功能库,但是 "),a("code",[r._v("cnchar")]),r._v(" 这个基础库是必须安装的")]),r._v(" "),a("p",[r._v("安装"),a("a",{attrs:{href:"https://npmjs.com/package/cnchar",target:"_blank",rel:"noopener noreferrer"}},[r._v("主库"),a("OutboundLink")],1),r._v(":")]),r._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[r._v("npm i cnchar\n")])])]),a("p",[r._v("按需安装功能库:")]),r._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[r._v("npm i cnchar-poly cnchar-order cnchar-trad cnchar-draw\n")])])]),a("p",[r._v("浏览器环境中功能库可以直接使用:")]),r._v(" "),a("div",[a("highlight-code",{attrs:{lang:"javascript"}},[r._v("\n import cnchar from 'cnchar';\n // 以下功能库请按需使用\n import 'cnchar-poly';\n import 'cnchar-order';\n import 'cnchar-trad';\n import 'cnchar-draw';\n ")])],1),r._v(" "),a("p",[r._v("非浏览器环境中功能库需要使用use方法加载,且不支持 "),a("code",[r._v("cnchar-draw")]),r._v(" 库:")]),r._v(" "),a("div",[a("highlight-code",{attrs:{lang:"javascript"}},[r._v("\n import cnchar from 'cnchar';\n // 以下功能库请按需使用\n import poly from 'cnchar-poly';\n import order from 'cnchar-order';\n import trad from 'cnchar-trad';\n cnchar.use(poly, order, trad);\n ")])],1),r._v(" "),a("p",[r._v("commonjs 模块")]),r._v(" "),a("div",[a("highlight-code",{attrs:{lang:"javascript"}},[r._v("\n var cnchar = require('cnchar');\n // 以下功能库请按需使用\n var poly = require('cnchar-poly');\n var order = require('cnchar-order');\n var trad = require('cnchar-trad');\n cnchar.use(poly, order, trad);\n ")])],1),r._v(" "),a("h2",{attrs:{id:"_2-cdn引用"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-cdn引用"}},[r._v("#")]),r._v(" 2. CDN引用")]),r._v(" "),a("p",[r._v("使用 script 标签使用:")]),r._v(" "),a("div",[a("highlight-code",{attrs:{lang:"html"}},[r._v('\n <script src="https://cdn.jsdelivr.net/npm/cnchar/cnchar.min.js"><\/script>\n \x3c!--以下功能库请按需使用--\x3e\n <script src="https://cdn.jsdelivr.net/npm/cnchar-poly/cnchar.poly.min.js"><\/script>\n <script src="https://cdn.jsdelivr.net/npm/cnchar-order/cnchar.order.min.js"><\/script>\n <script src="https://cdn.jsdelivr.net/npm/cnchar-trad/cnchar.trad.min.js"><\/script>\n <script src="https://cdn.jsdelivr.net/npm/cnchar-draw/cnchar.draw.min.js"><\/script>\n ')])],1),r._v(" "),a("h2",{attrs:{id:"_3-cnchar-all"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-cnchar-all"}},[r._v("#")]),r._v(" 3. cnchar-all")]),r._v(" "),a("p",[r._v("如果您需要使用cnchar及其插件的所有功能,可以通过安装"),a("code",[r._v("cnchar-all")]),r._v("来使用完整功能,这个库引用了上面的五个库")]),r._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[r._v("npm i cnchar-all\n")])])]),a("p",[r._v("commonjs 模块")]),r._v(" "),a("div",[a("highlight-code",{attrs:{lang:"javascript"}},[r._v("\n import cnchar from 'cnchar-all';\n ")])],1),r._v(" "),a("p",[r._v("cdn方式")]),r._v(" "),a("div",[a("highlight-code",{attrs:{lang:"html"}},[r._v('\n <script src="https://cdn.jsdelivr.net/npm/cnchar-all/cnchar.all.min.js"><\/script>\n ')])],1),r._v(" "),a("h2",{attrs:{id:"_4-简单使用"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-简单使用"}},[r._v("#")]),r._v(" 4. 简单使用")]),r._v(" "),a("p",[r._v("cnchar 具有两个最核心的方法"),a("code",[r._v("spell")]),r._v(" 和 "),a("code",[r._v("stroke")]),r._v(",分别用于获取汉字的拼音和笔画数:")]),r._v(" "),a("p",[a("codebox",{attrs:{id:"easy-use",title:"spell/stroke"}})],1),r._v(" "),a("p",[r._v("这只是一个最简单的使用,这两个方法具有很多参数可选,具体请参阅 "),a("a",{attrs:{href:""}},[r._v("cnchar")]),r._v(" 部分")])])}),[],!1,null,null,null);c.default=t.exports}}]);
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{632:function(r,c,a){"use strict";a.r(c);var n=a(21),t=Object(n.a)({},(function(){var r=this,c=r.$createElement,a=r._self._c||c;return a("ContentSlotsDistributor",{attrs:{"slot-key":r.$parent.slotKey}},[a("h2",{attrs:{id:"_1-npm安装"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-npm安装"}},[r._v("#")]),r._v(" 1. npm安装")]),r._v(" "),a("p",[r._v("cnchar包含了一个基本库和四个功能库,用于实现不同的功能,您可以按需安装其中的功能库,但是 "),a("code",[r._v("cnchar")]),r._v(" 这个基础库是必须安装的")]),r._v(" "),a("p",[r._v("安装"),a("a",{attrs:{href:"https://npmjs.com/package/cnchar",target:"_blank",rel:"noopener noreferrer"}},[r._v("主库"),a("OutboundLink")],1),r._v(":")]),r._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[r._v("npm i cnchar\n")])])]),a("p",[r._v("按需安装功能库:")]),r._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[r._v("npm i cnchar-poly cnchar-order cnchar-trad cnchar-draw\n")])])]),a("p",[r._v("浏览器环境中功能库可以直接使用:")]),r._v(" "),a("div",[a("highlight-code",{attrs:{lang:"javascript"}},[r._v("\n import cnchar from 'cnchar';\n // 以下功能库请按需使用\n import 'cnchar-poly';\n import 'cnchar-order';\n import 'cnchar-trad';\n import 'cnchar-draw';\n ")])],1),r._v(" "),a("p",[r._v("非浏览器环境中功能库需要使用use方法加载,且不支持 "),a("code",[r._v("cnchar-draw")]),r._v(" 库:")]),r._v(" "),a("div",[a("highlight-code",{attrs:{lang:"javascript"}},[r._v("\n import cnchar from 'cnchar';\n // 以下功能库请按需使用\n import poly from 'cnchar-poly';\n import order from 'cnchar-order';\n import trad from 'cnchar-trad';\n cnchar.use(poly, order, trad);\n ")])],1),r._v(" "),a("p",[r._v("commonjs 模块")]),r._v(" "),a("div",[a("highlight-code",{attrs:{lang:"javascript"}},[r._v("\n var cnchar = require('cnchar');\n // 以下功能库请按需使用\n var poly = require('cnchar-poly');\n var order = require('cnchar-order');\n var trad = require('cnchar-trad');\n cnchar.use(poly, order, trad);\n ")])],1),r._v(" "),a("h2",{attrs:{id:"_2-cdn引用"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-cdn引用"}},[r._v("#")]),r._v(" 2. CDN引用")]),r._v(" "),a("p",[r._v("使用 script 标签使用:")]),r._v(" "),a("div",[a("highlight-code",{attrs:{lang:"html"}},[r._v('\n <script src="https://cdn.jsdelivr.net/npm/cnchar/cnchar.min.js"><\/script>\n \x3c!--以下功能库请按需使用--\x3e\n <script src="https://cdn.jsdelivr.net/npm/cnchar-poly/cnchar.poly.min.js"><\/script>\n <script src="https://cdn.jsdelivr.net/npm/cnchar-order/cnchar.order.min.js"><\/script>\n <script src="https://cdn.jsdelivr.net/npm/cnchar-trad/cnchar.trad.min.js"><\/script>\n <script src="https://cdn.jsdelivr.net/npm/cnchar-draw/cnchar.draw.min.js"><\/script>\n ')])],1),r._v(" "),a("h2",{attrs:{id:"_3-cnchar-all"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-cnchar-all"}},[r._v("#")]),r._v(" 3. cnchar-all")]),r._v(" "),a("p",[r._v("如果您需要使用cnchar及其插件的所有功能,可以通过安装"),a("code",[r._v("cnchar-all")]),r._v("来使用完整功能,这个库引用了上面的五个库")]),r._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[r._v("npm i cnchar-all\n")])])]),a("p",[r._v("commonjs 模块")]),r._v(" "),a("div",[a("highlight-code",{attrs:{lang:"javascript"}},[r._v("\n import cnchar from 'cnchar-all';\n ")])],1),r._v(" "),a("p",[r._v("cdn方式")]),r._v(" "),a("div",[a("highlight-code",{attrs:{lang:"html"}},[r._v('\n <script src="https://cdn.jsdelivr.net/npm/cnchar-all/cnchar.all.min.js"><\/script>\n ')])],1),r._v(" "),a("h2",{attrs:{id:"_4-简单使用"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-简单使用"}},[r._v("#")]),r._v(" 4. 简单使用")]),r._v(" "),a("p",[r._v("cnchar 具有两个最核心的方法"),a("code",[r._v("spell")]),r._v(" 和 "),a("code",[r._v("stroke")]),r._v(",分别用于获取汉字的拼音和笔画数:")]),r._v(" "),a("p",[a("codebox",{attrs:{id:"easy-use",title:"spell/stroke"}})],1),r._v(" "),a("p",[r._v("这只是一个最简单的使用,这两个方法具有很多参数可选,具体请参阅 "),a("a",{attrs:{href:""}},[r._v("cnchar")]),r._v(" 部分")])])}),[],!1,null,null,null);c.default=t.exports}}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{535:function(t,s,a){},610:function(t,s,a){t.exports=a.p+"assets/img/logo.6cd28633.png"},611:function(t,s,a){"use strict";var i=a(535);a.n(i).a},621:function(t,s,a){"use strict";a.r(s);var i=[function(){var t=this.$createElement,s=this._self._c||t;return s("div",[s("img",{staticClass:"logo",attrs:{src:a(610),alt:"",srcset:""}})])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"feature-w"},[a("div",{staticClass:"f-i"},[a("div",{staticClass:"f-t"},[a("i",{staticClass:"ei-rocket"}),t._v("功能全面")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("拼音、笔画数")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("多音字词")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("繁体字、火星文")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("汉字笔顺")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("多种模式绘制汉字")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("汉字推算")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("...")])]),t._v(" "),a("div",{staticClass:"f-i"},[a("div",{staticClass:"f-t"},[a("i",{staticClass:"ei-tablet"}),t._v("多端支持")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("浏览器")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("nodejs")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("小程序/小游戏")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("ReactNative/Weex/Uniapp/Electron")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("webpack")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("typescript支持")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("...")])]),t._v(" "),a("div",{staticClass:"f-i"},[a("div",{staticClass:"f-t"},[a("i",{staticClass:"ei-cubes"}),t._v("按需取用")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("功能分包")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("体积小巧")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("简单易用")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("npm")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("cdn")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"copy-right"},[this._v("MIT Licensed | Copyright © 2020 present "),s("a",{attrs:{href:"https://www.github.com/theajack",target:"view_window"}},[this._v("theajack")])])}],e=(a(198),a(39),a(57),a(93),{data:function(){return{text:"",spell:"",stroke:"",trad:"",spark:"",order:""}},methods:{input:function(){if(this.text){this.spell=this.text.spell("array","tone").join(" "),this.stroke=this.text.stroke(),this.trad=this.text.convertSimpleToTrad("trad"),this.spark=this.text.convertSimpleToSpark("spark"),this.order=JSON.stringify(this.text.stroke("order","shape")).replace(/"/g,"").replace(/null/g,"无");var t=this.pickCnChar(this.text),s=document.getElementById("draw-area");s.innerHTML="",""!==t&&window.cnchar.draw(t,{el:s})}},isCnChar:function(t){var s=t.charCodeAt(0);return s>=19968&&s<=40869},pickCnChar:function(t){for(var s="",a=0;a<t.length;a++)this.isCnChar(t[a])&&(s+=t[a]);return s},start:function(){window.location.href="/cnchar/v2/guide/"}},mounted:function(){var t=setInterval((function(){var s=document.getElementById("vcomments");s&&(s.className+=" home-comment",clearInterval(t))}),500)}}),v=(a(611),a(21)),r=Object(v.a)(e,(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"home-wrapper"},[t._m(0),t._v(" "),a("div",{staticClass:"title"},[t._v("cnchar")]),t._v(" "),a("div",{staticClass:"desc"},[t._v("功能全面、多端支持的汉字拼音笔画js库")]),t._v(" "),a("div",{staticClass:"test"},[a("el-input",{staticClass:"test-input",attrs:{type:"text",placeholder:"输入一些汉字试试"},on:{input:t.input},model:{value:t.text,callback:function(s){t.text=s},expression:"text"}}),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:""!==t.text,expression:'text!==""'}],staticClass:"show-area"},[a("div",[t._v(t._s(t.spell)+" "),a("span",{staticClass:"split"},[t._v("|")]),t._v(" 共"+t._s(t.stroke)+"笔")]),t._v(" "),a("div",[t._v("繁体: "+t._s(t.trad)+" "),a("span",{staticClass:"split"},[t._v("|")]),t._v(" 火星文: "+t._s(t.spark))]),t._v(" "),a("div",[t._v("笔顺: "+t._s(t.order))]),t._v(" "),a("div",{attrs:{id:"draw-area"}})])],1),t._v(" "),a("div",{staticClass:"start-w"},[a("el-button",{attrs:{type:"primary"},on:{click:t.start}},[t._v("开始 "),a("i",{staticClass:"ei-location-arrow"})])],1),t._v(" "),t._m(1),t._v(" "),t._m(2)])}),i,!1,null,null,null);s.default=r.exports}}]);
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{535:function(t,s,a){},610:function(t,s,a){t.exports=a.p+"assets/img/logo.6cd28633.png"},611:function(t,s,a){"use strict";var i=a(535);a.n(i).a},621:function(t,s,a){"use strict";a.r(s);var i=[function(){var t=this.$createElement,s=this._self._c||t;return s("div",[s("img",{staticClass:"logo",attrs:{src:a(610),alt:"",srcset:""}})])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"feature-w"},[a("div",{staticClass:"f-i"},[a("div",{staticClass:"f-t"},[a("i",{staticClass:"ei-rocket"}),t._v("功能全面")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("拼音、笔画数")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("多音字词")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("繁体字、火星文")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("汉字笔顺")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("多种模式绘制汉字")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("汉字推算")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("...")])]),t._v(" "),a("div",{staticClass:"f-i"},[a("div",{staticClass:"f-t"},[a("i",{staticClass:"ei-tablet"}),t._v("多端支持")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("浏览器")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("nodejs")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("小程序/小游戏")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("ReactNative/Weex/Uniapp/Electron")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("webpack")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("typescript支持")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("...")])]),t._v(" "),a("div",{staticClass:"f-i"},[a("div",{staticClass:"f-t"},[a("i",{staticClass:"ei-cubes"}),t._v("按需取用")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("功能分包")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("体积小巧")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("简单易用")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("npm")]),t._v(" "),a("div",{staticClass:"f-des"},[t._v("cdn")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"copy-right"},[this._v("MIT Licensed | Copyright © 2020 present "),s("a",{attrs:{href:"https://www.github.com/theajack",target:"view_window"}},[this._v("theajack")])])}],e=(a(198),a(39),a(57),a(96),{data:function(){return{text:"",spell:"",stroke:"",trad:"",spark:"",order:""}},methods:{input:function(){if(this.text){this.spell=this.text.spell("array","tone").join(" "),this.stroke=this.text.stroke(),this.trad=this.text.convertSimpleToTrad("trad"),this.spark=this.text.convertSimpleToSpark("spark"),this.order=JSON.stringify(this.text.stroke("order","shape")).replace(/"/g,"").replace(/null/g,"无");var t=this.pickCnChar(this.text),s=document.getElementById("draw-area");s.innerHTML="",""!==t&&window.cnchar.draw(t,{el:s})}},isCnChar:function(t){var s=t.charCodeAt(0);return s>=19968&&s<=40869},pickCnChar:function(t){for(var s="",a=0;a<t.length;a++)this.isCnChar(t[a])&&(s+=t[a]);return s},start:function(){window.location.href="/cnchar/v2/guide/"}},mounted:function(){var t=setInterval((function(){var s=document.getElementById("vcomments");s&&(s.className+=" home-comment",clearInterval(t))}),500)}}),v=(a(611),a(21)),r=Object(v.a)(e,(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"home-wrapper"},[t._m(0),t._v(" "),a("div",{staticClass:"title"},[t._v("cnchar")]),t._v(" "),a("div",{staticClass:"desc"},[t._v("功能全面、多端支持的汉字拼音笔画js库")]),t._v(" "),a("div",{staticClass:"test"},[a("el-input",{staticClass:"test-input",attrs:{type:"text",placeholder:"输入一些汉字试试"},on:{input:t.input},model:{value:t.text,callback:function(s){t.text=s},expression:"text"}}),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:""!==t.text,expression:'text!==""'}],staticClass:"show-area"},[a("div",[t._v(t._s(t.spell)+" "),a("span",{staticClass:"split"},[t._v("|")]),t._v(" 共"+t._s(t.stroke)+"笔")]),t._v(" "),a("div",[t._v("繁体: "+t._s(t.trad)+" "),a("span",{staticClass:"split"},[t._v("|")]),t._v(" 火星文: "+t._s(t.spark))]),t._v(" "),a("div",[t._v("笔顺: "+t._s(t.order))]),t._v(" "),a("div",{attrs:{id:"draw-area"}})])],1),t._v(" "),a("div",{staticClass:"start-w"},[a("el-button",{attrs:{type:"primary"},on:{click:t.start}},[t._v("开始 "),a("i",{staticClass:"ei-location-arrow"})])],1),t._v(" "),t._m(1),t._v(" "),t._m(2)])}),i,!1,null,null,null);s.default=r.exports}}]);
|
File diff suppressed because one or more lines are too long
|
@ -8,8 +8,8 @@
|
|||
<meta name="generator" content="VuePress 1.4.0">
|
||||
<link rel="icon" href="https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/v1/images/i.ico">
|
||||
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.024b3107.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.5180ea63.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/10.54779f86.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/3.f58208b0.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.941af31d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.30e2dc9c.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.f192de8f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.48f87de9.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.15effdce.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.8bbe7e50.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css">
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.9898ab08.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.810c9b70.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.aecccbc9.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/10.54779f86.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/3.8c8d8cb2.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.ab53158a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.8edf06e3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.be7b0b94.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.a3e47921.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.eb7f4709.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.dd3fb50d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.9898ab08.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/cnchar/v2/" class="home-link router-link-active"><!----> <span class="site-name">cnchar</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/cnchar/v2/" class="nav-link">
|
||||
|
@ -57,21 +57,21 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="https://blog.csdn.net/yanxiaomu" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
CSDN账号
|
||||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>cnchar文档</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/cnchar/v2/doc/cnchar.html" class="active sidebar-link">cnchar</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/cnchar.html#_1-介绍" class="sidebar-link">1. 介绍</a></li><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/cnchar.html#_2-spell-方法" class="sidebar-link">2. spell 方法</a></li><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/cnchar.html#_3-stroke-方法" class="sidebar-link">3. stroke 方法</a></li><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/cnchar.html#_4-通过拼音查询原汉字" class="sidebar-link">4. 通过拼音查询原汉字</a></li><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/cnchar.html#_5-通过笔画数查询原汉字" class="sidebar-link">5. 通过笔画数查询原汉字</a></li><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/cnchar.html#_6-查询拼音详细信息" class="sidebar-link">6. 查询拼音详细信息</a></li><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/cnchar.html#_7-其他api" class="sidebar-link">7. 其他api</a></li></ul></li><li><a href="/cnchar/v2/doc/poly.html" class="sidebar-link">cnchar-poly</a></li><li><a href="/cnchar/v2/doc/order.html" class="sidebar-link">cnchar-order</a></li><li><a href="/cnchar/v2/doc/trad.html" class="sidebar-link">cnchar-trad</a></li><li><a href="/cnchar/v2/doc/draw.html" class="sidebar-link">cnchar-draw</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h2 id="_1-介绍"><a href="#_1-介绍" class="header-anchor">#</a> 1. 介绍</h2> <p>cnchar 库是基本库,主要包含汉字 <code>拼音</code> 和 <code>笔画数</code> 的获取</p> <p>除此之外,还支持 <code>通过拼音查询原汉字</code>, <code>通过笔画数查询原汉字</code>, <code>查询拼音详细信息</code> 等功能</p> <p>ts类型声明:<a href="https://github.com/theajack/cnchar/blob/master/src/main/index.d.ts" target="_blank" rel="noopener noreferrer">cnchar.d.ts<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p> <h2 id="_2-spell-方法"><a href="#_2-spell-方法" class="header-anchor">#</a> 2. spell 方法</h2> <p>spell 方法用户获取汉字拼音,支持 数组分割、首字母,大小写、候选多音字、音调、繁简体功能</p> <h3 id="_2-1-api使用"><a href="#_2-1-api使用" class="header-anchor">#</a> 2.1. api使用</h3> <p>api调用方式如下,所有 arg 参数都是可选的</p> <div><pre><code class="hljs javascript">cnchar.spell(string,arg1,arg2,...);
|
||||
string.spell(arg1,arg2,...); <span class="hljs-comment">// string prototype 调用</span></code></pre></div> <p>以下是几个简单的例子:</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>spell</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <h3 id="_2-2-参数说明"><a href="#_2-2-参数说明" class="header-anchor">#</a> 2.2. 参数说明</h3> <p>arg 参数信息如下:</p> <table><thead><tr><th style="text-align:center;">参数</th> <th style="text-align:center;">作用</th> <th style="text-align:center;">是否默认</th> <th style="text-align:center;">依赖库</th> <th style="text-align:center;">备注</th></tr></thead> <tbody><tr><td style="text-align:center;">array</td> <td style="text-align:center;">返回数组</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">first</td> <td style="text-align:center;">返回拼音首字母</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">up</td> <td style="text-align:center;">将结果全部大写</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">low</td> <td style="text-align:center;">将结果全部小写</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">会被 up 参数覆盖</td></tr> <tr><td style="text-align:center;">poly</td> <td style="text-align:center;">使用候选多音字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">tone</td> <td style="text-align:center;">启用音调</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">simple</td> <td style="text-align:center;">是否禁用繁体字的拼音功能</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-trad</td> <td style="text-align:center;">使用 cnchar-trad 之后,默认对繁体字拼音进行转换,该参数用于禁用繁体字拼音</td></tr></tbody></table> <h2 id="_3-stroke-方法"><a href="#_3-stroke-方法" class="header-anchor">#</a> 3. stroke 方法</h2> <h3 id="_2-1-api使用-2"><a href="#_2-1-api使用-2" class="header-anchor">#</a> 2.1. api使用</h3> <p>api调用方式如下,所有 arg 参数都是可选的</p> <div><pre><code class="hljs javascript">cnchar.stroke(string,arg1,arg2,...);
|
||||
string.stroke(arg1,arg2,...); <span class="hljs-comment">// string prototype 调用</span></code></pre></div> <p>以下是几个简单的例子:</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>stroke</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <h3 id="_2-2-参数说明-2"><a href="#_2-2-参数说明-2" class="header-anchor">#</a> 2.2. 参数说明</h3> <p>arg 参数信息如下:</p> <table><thead><tr><th style="text-align:center;">参数</th> <th style="text-align:center;">作用</th> <th style="text-align:center;">是否默认</th> <th style="text-align:center;">依赖库</th> <th style="text-align:center;">备注</th></tr></thead> <tbody><tr><td style="text-align:center;">array</td> <td style="text-align:center;">返回数组</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">使用 cnchar-order 且启用 order 参数后该参数被忽略</td></tr> <tr><td style="text-align:center;">order</td> <td style="text-align:center;">启用笔画顺序</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">letter</td> <td style="text-align:center;">使用笔画顺序字母序列</td> <td style="text-align:center;">是</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">当启用 order 后,该值是默认值</td></tr> <tr><td style="text-align:center;">detail</td> <td style="text-align:center;">使用笔画顺序详情作为返回值,每个汉字对应一个 json</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">优先级小于 letter</td></tr> <tr><td style="text-align:center;">shape</td> <td style="text-align:center;">使用笔画形状作为返回值</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">优先级小于 detail</td></tr> <tr><td style="text-align:center;">name</td> <td style="text-align:center;">使用笔画名称作为返回值</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">优先级小于 shape</td></tr> <tr><td style="text-align:center;">count</td> <td style="text-align:center;">使用笔画数作为返回值</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-poly</td> <td style="text-align:center;">优先级小于 name</td></tr> <tr><td style="text-align:center;">simple</td> <td style="text-align:center;">是否禁用繁体字的笔画功能</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-trad</td> <td style="text-align:center;">使用 cnchar-trad 之后,默认对繁体字启用笔画功能,该参数用于禁用繁体字笔画功能</td></tr></tbody></table> <h2 id="_4-通过拼音查询原汉字"><a href="#_4-通过拼音查询原汉字" class="header-anchor">#</a> 4. 通过拼音查询原汉字</h2> <h3 id="_4-1-api使用"><a href="#_4-1-api使用" class="header-anchor">#</a> 4.1 api使用</h3> <p>api调用方式如下,所有 arg 参数都是可选的</p> <div><pre><code class="hljs javascript">cnchar.spellToWord(spell,arg1,arg2,...);</code></pre></div> <p>spell 表示拼音,可以使用音调字母或音调数标方式:</p> <p><strong>例:<code>shàng 等价于 shang4</code></strong></p> <p><strong>ü 可以使用 v 表示,例:<code>lü 等价于 lv</code></strong></p> <p>以下是几个简单的例子:</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>spellToWord</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <h3 id="_4-2-参数信息"><a href="#_4-2-参数信息" class="header-anchor">#</a> 4.2 参数信息</h3> <p>arg 参数信息如下:</p> <table><thead><tr><th style="text-align:center;">参数</th> <th style="text-align:center;">作用</th> <th style="text-align:center;">是否默认</th> <th style="text-align:center;">依赖库</th> <th style="text-align:center;">备注</th></tr></thead> <tbody><tr><td style="text-align:center;">simple</td> <td style="text-align:center;">仅匹配简体字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">trad</td> <td style="text-align:center;">仅匹配繁体字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-trad</td> <td style="text-align:center;">该参数仅在引入了 <code>cnchar-trad</code> 后有效</td></tr> <tr><td style="text-align:center;">poly</td> <td style="text-align:center;">仅匹配多音字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">alltone</td> <td style="text-align:center;">匹配该拼音所有音调的汉字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">没有音调的拼音表示轻声</td></tr> <tr><td style="text-align:center;">array</td> <td style="text-align:center;">返回符合条件的数组,默认返回的是字符串</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr></tbody></table> <p>注:<code>simple</code>与<code>trad</code>参数若是都不存在,则当引入<code>cnchar-trad</code>时会同时匹配繁简体,没有引入<code>cnchar-trad</code>时则只匹配简体</p> <h2 id="_5-通过笔画数查询原汉字"><a href="#_5-通过笔画数查询原汉字" class="header-anchor">#</a> 5. 通过笔画数查询原汉字</h2> <h3 id="_5-1-api使用"><a href="#_5-1-api使用" class="header-anchor">#</a> 5.1 api使用</h3> <p>api调用方式如下,count表示笔画数,所有 arg 参数都是可选的</p> <div><pre><code class="hljs javascript">cnchar.strokeToWord(count,arg1,arg2,...);</code></pre></div> <p>以下是几个简单的例子:</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>strokeToWord</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <h3 id="_5-2-参数信息"><a href="#_5-2-参数信息" class="header-anchor">#</a> 5.2 参数信息</h3> <p>arg 参数信息如下:</p> <table><thead><tr><th style="text-align:center;">参数</th> <th style="text-align:center;">作用</th> <th style="text-align:center;">是否默认</th> <th style="text-align:center;">依赖库</th> <th style="text-align:center;">备注</th></tr></thead> <tbody><tr><td style="text-align:center;">simple</td> <td style="text-align:center;">仅匹配简体字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">trad</td> <td style="text-align:center;">仅匹配繁体字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-trad</td> <td style="text-align:center;">该参数仅在引入了 <code>cnchar-trad</code> 后有效</td></tr> <tr><td style="text-align:center;">array</td> <td style="text-align:center;">返回符合条件的数组,默认返回的是字符串</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr></tbody></table> <p>注:<code>simple</code>与<code>trad</code>参数若是都不存在,则当引入<code>cnchar-trad</code>时会同时匹配繁简体,没有引入<code>cnchar-trad</code>时则只匹配简体</p> <h2 id="_6-查询拼音详细信息"><a href="#_6-查询拼音详细信息" class="header-anchor">#</a> 6. 查询拼音详细信息</h2> <h3 id="_6-1-api使用"><a href="#_6-1-api使用" class="header-anchor">#</a> 6.1 api使用</h3> <p><code>spellInfo</code> 方法用于查询拼音的详细信息,用法如下:</p> <div><pre><code class="hljs javascript">cnchar.spellInfo(spell);</code></pre></div> <p>该方法返回一个json:</p> <div><pre><code class="hljs json">{
|
||||
string.spell(arg1,arg2,...); <span class="hljs-comment">// string prototype 调用</span></code></pre></div> <p>以下是几个简单的例子:</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>spell</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <h3 id="_2-2-参数说明"><a href="#_2-2-参数说明" class="header-anchor">#</a> 2.2. 参数说明</h3> <p>arg 参数信息如下:</p> <table><thead><tr><th style="text-align:center;">参数</th> <th style="text-align:center;">作用</th> <th style="text-align:center;">是否默认</th> <th style="text-align:center;">依赖库</th> <th style="text-align:center;">备注</th></tr></thead> <tbody><tr><td style="text-align:center;">array</td> <td style="text-align:center;">返回数组</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">first</td> <td style="text-align:center;">返回拼音首字母</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">up</td> <td style="text-align:center;">将结果全部大写</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">low</td> <td style="text-align:center;">将结果全部小写</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">会被 up 参数覆盖</td></tr> <tr><td style="text-align:center;">poly</td> <td style="text-align:center;">使用候选多音字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">tone</td> <td style="text-align:center;">启用音调</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">simple</td> <td style="text-align:center;">是否禁用繁体字的拼音功能</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-trad</td> <td style="text-align:center;">使用 cnchar-trad 之后,默认对繁体字拼音进行转换,该参数用于禁用繁体字拼音</td></tr></tbody></table> <h2 id="_3-stroke-方法"><a href="#_3-stroke-方法" class="header-anchor">#</a> 3. stroke 方法</h2> <h3 id="_2-1-api使用-2"><a href="#_2-1-api使用-2" class="header-anchor">#</a> 2.1. api使用</h3> <p>api调用方式如下,所有 arg 参数都是可选的</p> <div><pre><code class="hljs javascript">cnchar.stroke(string,arg1,arg2,...);
|
||||
string.stroke(arg1,arg2,...); <span class="hljs-comment">// string prototype 调用</span></code></pre></div> <p>以下是几个简单的例子:</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>stroke</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <h3 id="_2-2-参数说明-2"><a href="#_2-2-参数说明-2" class="header-anchor">#</a> 2.2. 参数说明</h3> <p>arg 参数信息如下:</p> <table><thead><tr><th style="text-align:center;">参数</th> <th style="text-align:center;">作用</th> <th style="text-align:center;">是否默认</th> <th style="text-align:center;">依赖库</th> <th style="text-align:center;">备注</th></tr></thead> <tbody><tr><td style="text-align:center;">array</td> <td style="text-align:center;">返回数组</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">使用 cnchar-order 且启用 order 参数后该参数被忽略</td></tr> <tr><td style="text-align:center;">order</td> <td style="text-align:center;">启用笔画顺序</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">letter</td> <td style="text-align:center;">使用笔画顺序字母序列</td> <td style="text-align:center;">是</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">当启用 order 后,该值是默认值</td></tr> <tr><td style="text-align:center;">detail</td> <td style="text-align:center;">使用笔画顺序详情作为返回值,每个汉字对应一个 json</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">优先级小于 letter</td></tr> <tr><td style="text-align:center;">shape</td> <td style="text-align:center;">使用笔画形状作为返回值</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">优先级小于 detail</td></tr> <tr><td style="text-align:center;">name</td> <td style="text-align:center;">使用笔画名称作为返回值</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">优先级小于 shape</td></tr> <tr><td style="text-align:center;">count</td> <td style="text-align:center;">使用笔画数作为返回值</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-poly</td> <td style="text-align:center;">优先级小于 name</td></tr> <tr><td style="text-align:center;">simple</td> <td style="text-align:center;">是否禁用繁体字的笔画功能</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-trad</td> <td style="text-align:center;">使用 cnchar-trad 之后,默认对繁体字启用笔画功能,该参数用于禁用繁体字笔画功能</td></tr></tbody></table> <h2 id="_4-通过拼音查询原汉字"><a href="#_4-通过拼音查询原汉字" class="header-anchor">#</a> 4. 通过拼音查询原汉字</h2> <h3 id="_4-1-api使用"><a href="#_4-1-api使用" class="header-anchor">#</a> 4.1 api使用</h3> <p>api调用方式如下,所有 arg 参数都是可选的</p> <div><pre><code class="hljs javascript">cnchar.spellToWord(spell,arg1,arg2,...);</code></pre></div> <p>spell 表示拼音,可以使用音调字母或音调数标方式:</p> <p><strong>例:<code>shàng 等价于 shang4</code></strong></p> <p><strong>ü 可以使用 v 表示,例:<code>lü 等价于 lv</code></strong></p> <p>以下是几个简单的例子:</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>spellToWord</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <h3 id="_4-2-参数信息"><a href="#_4-2-参数信息" class="header-anchor">#</a> 4.2 参数信息</h3> <p>arg 参数信息如下:</p> <table><thead><tr><th style="text-align:center;">参数</th> <th style="text-align:center;">作用</th> <th style="text-align:center;">是否默认</th> <th style="text-align:center;">依赖库</th> <th style="text-align:center;">备注</th></tr></thead> <tbody><tr><td style="text-align:center;">simple</td> <td style="text-align:center;">仅匹配简体字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">trad</td> <td style="text-align:center;">仅匹配繁体字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-trad</td> <td style="text-align:center;">该参数仅在引入了 <code>cnchar-trad</code> 后有效</td></tr> <tr><td style="text-align:center;">poly</td> <td style="text-align:center;">仅匹配多音字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">alltone</td> <td style="text-align:center;">匹配该拼音所有音调的汉字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">没有音调的拼音表示轻声</td></tr> <tr><td style="text-align:center;">array</td> <td style="text-align:center;">返回符合条件的数组,默认返回的是字符串</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr></tbody></table> <p>注:<code>simple</code>与<code>trad</code>参数若是都不存在,则当引入<code>cnchar-trad</code>时会同时匹配繁简体,没有引入<code>cnchar-trad</code>时则只匹配简体</p> <h2 id="_5-通过笔画数查询原汉字"><a href="#_5-通过笔画数查询原汉字" class="header-anchor">#</a> 5. 通过笔画数查询原汉字</h2> <h3 id="_5-1-api使用"><a href="#_5-1-api使用" class="header-anchor">#</a> 5.1 api使用</h3> <p>api调用方式如下,count表示笔画数,所有 arg 参数都是可选的</p> <div><pre><code class="hljs javascript">cnchar.strokeToWord(count,arg1,arg2,...);</code></pre></div> <p>以下是几个简单的例子:</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>strokeToWord</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <h3 id="_5-2-参数信息"><a href="#_5-2-参数信息" class="header-anchor">#</a> 5.2 参数信息</h3> <p>arg 参数信息如下:</p> <table><thead><tr><th style="text-align:center;">参数</th> <th style="text-align:center;">作用</th> <th style="text-align:center;">是否默认</th> <th style="text-align:center;">依赖库</th> <th style="text-align:center;">备注</th></tr></thead> <tbody><tr><td style="text-align:center;">simple</td> <td style="text-align:center;">仅匹配简体字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">trad</td> <td style="text-align:center;">仅匹配繁体字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-trad</td> <td style="text-align:center;">该参数仅在引入了 <code>cnchar-trad</code> 后有效</td></tr> <tr><td style="text-align:center;">array</td> <td style="text-align:center;">返回符合条件的数组,默认返回的是字符串</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr></tbody></table> <p>注:<code>simple</code>与<code>trad</code>参数若是都不存在,则当引入<code>cnchar-trad</code>时会同时匹配繁简体,没有引入<code>cnchar-trad</code>时则只匹配简体</p> <h2 id="_6-查询拼音详细信息"><a href="#_6-查询拼音详细信息" class="header-anchor">#</a> 6. 查询拼音详细信息</h2> <h3 id="_6-1-api使用"><a href="#_6-1-api使用" class="header-anchor">#</a> 6.1 api使用</h3> <p><code>spellInfo</code> 方法用于查询拼音的详细信息,用法如下:</p> <div><pre><code class="hljs javascript">cnchar.spellInfo(spell);</code></pre></div> <p>该方法返回一个json:</p> <div><pre><code class="hljs json">{
|
||||
<span class="hljs-attr">"spell"</span>: string, <span class="hljs-comment">// 去音调的拼音小写</span>
|
||||
<span class="hljs-attr">"tone"</span>: number, <span class="hljs-comment">// 音调 0-5</span>
|
||||
<span class="hljs-attr">"index"</span>: number, <span class="hljs-comment">// 音调位置</span>
|
||||
<span class="hljs-attr">"initial"</span>: string, <span class="hljs-comment">// 声母</span>
|
||||
<span class="hljs-attr">"final"</span>: string <span class="hljs-comment">// 韵母</span>
|
||||
}</code></pre></div> <p>以下是一个简单的例子:</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>spellInfo</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <h3 id="_6-2-声母"><a href="#_6-2-声母" class="header-anchor">#</a> 6.2 声母</h3> <p><code>cnchar.spellInfo.initials</code> 方法用于获取所有的声母,用法如下:</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>initials</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <h3 id="_6-3-音调"><a href="#_6-3-音调" class="header-anchor">#</a> 6.3 音调</h3> <p><code>cnchar.spellInfo.tones</code> 方法用于获取所有的音调,用法如下:</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>tones</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <p>注:n 的一声使用 * 代替</p> <h2 id="_7-其他api"><a href="#_7-其他api" class="header-anchor">#</a> 7. 其他api</h2> <h3 id="_7-1-use"><a href="#_7-1-use" class="header-anchor">#</a> 7.1 .use()</h3> <p>这个 api 的功能是显式启用 <code>poly</code>、<code>order</code>、<code>trad</code>、<code>draw</code> 四个功能库</p> <div><pre><code class="hljs javascript">cnchar.use(...libs);</code></pre></div> <p>这个启用在非浏览器环境(比如 nodejs 等)中是必须的,使用如下:</p> <div><pre><code class="hljs javascript"><span class="hljs-comment">// 请保证最先引入 cnchar 基础库,其他几个库顺序无所谓</span>
|
||||
}</code></pre></div> <p>以下是一个简单的例子:</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>spellInfo</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <h3 id="_6-2-声母"><a href="#_6-2-声母" class="header-anchor">#</a> 6.2 声母</h3> <p><code>cnchar.spellInfo.initials</code> 方法用于获取所有的声母,用法如下:</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>initials</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <h3 id="_6-3-音调"><a href="#_6-3-音调" class="header-anchor">#</a> 6.3 音调</h3> <p><code>cnchar.spellInfo.tones</code> 方法用于获取所有的音调,用法如下:</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>tones</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <p>注:n 的一声使用 * 代替</p> <h2 id="_7-其他api"><a href="#_7-其他api" class="header-anchor">#</a> 7. 其他api</h2> <h3 id="_7-1-use"><a href="#_7-1-use" class="header-anchor">#</a> 7.1 .use()</h3> <p>这个 api 的功能是显式启用 <code>poly</code>、<code>order</code>、<code>trad</code>、<code>draw</code> 四个功能库</p> <div><pre><code class="hljs javascript">cnchar.use(...libs);</code></pre></div> <p>这个启用在非浏览器环境(比如 nodejs 等)中是必须的,使用如下:</p> <div><pre><code class="hljs javascript"><span class="hljs-comment">// 请保证最先引入 cnchar 基础库,其他几个库顺序无所谓</span>
|
||||
<span class="hljs-keyword">var</span> cnchar = <span class="hljs-built_in">require</span>(<span class="hljs-string">'cnchar'</span>);
|
||||
<span class="hljs-keyword">var</span> poly = <span class="hljs-built_in">require</span>(<span class="hljs-string">'cnchar-poly'</span>);
|
||||
<span class="hljs-keyword">var</span> order = <span class="hljs-built_in">require</span>(<span class="hljs-string">'cnchar-order'</span>);
|
||||
|
@ -81,14 +81,14 @@ cnchar.use(poly, order, trad); <span class="hljs-comment">// 参数顺序无关
|
|||
<span class="hljs-keyword">import</span> <span class="hljs-string">'cnchar-poly'</span>;
|
||||
<span class="hljs-keyword">import</span> <span class="hljs-string">'cnchar-order'</span>;
|
||||
<span class="hljs-keyword">import</span> <span class="hljs-string">'cnchar-trad'</span>;
|
||||
<span class="hljs-keyword">import</span> <span class="hljs-string">'cnchar-draw'</span>;</code></pre></div> <h3 id="_7-2-type"><a href="#_7-2-type" class="header-anchor">#</a> 7.2 .type</h3> <p>type 对象用户获取当前可用的 <code>spell</code> 、 <code>stroke</code> 、 <code>orderToWord</code> 、<code>spellToWord</code>、<code>strokeToWord</code> 参数类型:</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>type</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <h3 id="_7-3-check"><a href="#_7-3-check" class="header-anchor">#</a> 7.3 .check</h3> <p>该值是一个 布尔类型,用于控制是否开启参数校验,默认值为 true</p> <p>cnchar带有的参数校验功能能够对 <code>spell</code> 和 <code>stroke</code> 传入的参数进行检查,在控制台显示 <code>无效·</code>,<code>忽略</code>和<code>冗余</code>的参数</p> <div><pre><code class="hljs javascript">cnchar.check = <span class="hljs-literal">false</span>; <span class="hljs-comment">// 关闭参数校验</span></code></pre></div> <h3 id="_7-4-version"><a href="#_7-4-version" class="header-anchor">#</a> 7.4 .version</h3> <p>获取当前版本:</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>version</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <h3 id="_7-5-plugins"><a href="#_7-5-plugins" class="header-anchor">#</a> 7.5 .plugins</h3> <p>当前使用的功能库列表,最多的情况为 <code>["order", "trad", "poly", "draw"]</code></p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>plugins</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/12/2020, 10:44:57 PM</span></div></footer> <div class="page-nav"><p class="inner"><!----> <span class="next"><a href="/cnchar/v2/doc/poly.html">
|
||||
<span class="hljs-keyword">import</span> <span class="hljs-string">'cnchar-draw'</span>;</code></pre></div> <h3 id="_7-2-type"><a href="#_7-2-type" class="header-anchor">#</a> 7.2 .type</h3> <p>type 对象用户获取当前可用的 <code>spell</code> 、 <code>stroke</code> 、 <code>orderToWord</code> 、<code>spellToWord</code>、<code>strokeToWord</code> 参数类型:</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>type</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <h3 id="_7-3-check"><a href="#_7-3-check" class="header-anchor">#</a> 7.3 .check</h3> <p>该值是一个 布尔类型,用于控制是否开启参数校验,默认值为 true</p> <p>cnchar带有的参数校验功能能够对 <code>spell</code> 和 <code>stroke</code> 传入的参数进行检查,在控制台显示 <code>无效·</code>,<code>忽略</code>和<code>冗余</code>的参数</p> <div><pre><code class="hljs javascript">cnchar.check = <span class="hljs-literal">false</span>; <span class="hljs-comment">// 关闭参数校验</span></code></pre></div> <h3 id="_7-4-version"><a href="#_7-4-version" class="header-anchor">#</a> 7.4 .version</h3> <p>获取当前版本:</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>version</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <h3 id="_7-5-plugins"><a href="#_7-5-plugins" class="header-anchor">#</a> 7.5 .plugins</h3> <p>当前使用的功能库列表,最多的情况为 <code>["order", "trad", "poly", "draw"]</code></p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>plugins</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/12/2020, 10:44:57 PM</span></div></footer> <div class="page-nav"><p class="inner"><!----> <span class="next"><a href="/cnchar/v2/doc/poly.html">
|
||||
cnchar-poly
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"><!----><div></div></div></div>
|
||||
<script src="/cnchar/v2/assets/js/app.024b3107.js" defer></script><script src="/cnchar/v2/assets/js/2.5180ea63.js" defer></script><script src="/cnchar/v2/assets/js/10.54779f86.js" defer></script><script src="/cnchar/v2/assets/js/3.f58208b0.js" defer></script>
|
||||
<script src="/cnchar/v2/assets/js/app.810c9b70.js" defer></script><script src="/cnchar/v2/assets/js/2.aecccbc9.js" defer></script><script src="/cnchar/v2/assets/js/10.54779f86.js" defer></script><script src="/cnchar/v2/assets/js/3.8c8d8cb2.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<meta name="generator" content="VuePress 1.4.0">
|
||||
<link rel="icon" href="https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/v1/images/i.ico">
|
||||
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.024b3107.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.5180ea63.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/11.a2eec2e7.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/3.f58208b0.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.941af31d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.30e2dc9c.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.f192de8f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.48f87de9.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.15effdce.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.8bbe7e50.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css">
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.9898ab08.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.810c9b70.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.aecccbc9.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/11.a2eec2e7.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/3.8c8d8cb2.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.ab53158a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.8edf06e3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.be7b0b94.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.a3e47921.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.eb7f4709.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.dd3fb50d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.9898ab08.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/cnchar/v2/" class="home-link router-link-active"><!----> <span class="site-name">cnchar</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/cnchar/v2/" class="nav-link">
|
||||
|
@ -104,15 +104,15 @@ draw(<span class="hljs-string">'你好'</span>)</code></pre></div> <h2 id="_2-
|
|||
highlightCompleteColor?: <span class="hljs-built_in">number</span>;<span class="hljs-comment">// : null, // 十六进制字符, 默认 null。 在测验中突出显示字符时使用的颜色。 如果未设置,则将使用highlightColor。 仅当highlightOnComplete为true时才相关。</span>
|
||||
onTestStatus?<span class="hljs-function">(<span class="hljs-params">args: TestStatus</span>):<span class="hljs-params">void</span>;// : <span class="hljs-params">null</span>, // (<span class="hljs-params">{index, status, data}</span>)=></span>{}
|
||||
}
|
||||
};</code></pre></div> <h2 id="_3-常规绘制实例"><a href="#_3-常规绘制实例" class="header-anchor">#</a> 3. 常规绘制实例</h2> <p>绘制模式默认为常规模式 <code>type=normal</code></p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>normal-draw</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <h2 id="_4-笔顺绘制实例"><a href="#_4-笔顺绘制实例" class="header-anchor">#</a> 4. 笔顺绘制实例</h2> <p>当<code>type=stroke</code>时,笔顺模式启用,该模式会单笔绘制汉字的每一个笔划,并且为每一个笔划生成一个绘制块</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>stroke-draw</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <h2 id="_5-动画绘制模式"><a href="#_5-动画绘制模式" class="header-anchor">#</a> 5. 动画绘制模式</h2> <p>当<code>type=animation</code>时,动画模式启用,该模式会按笔顺用动画绘制每一个笔划</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>animation-draw</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <h2 id="_6-测验模式"><a href="#_6-测验模式" class="header-anchor">#</a> 6. 测验模式</h2> <p>当<code>type=test</code>时,测验模式启用,该模式用户可以在容器内绘制汉字,cnchar-draw会检测是否绘制正确</p> <p>请用鼠标在绘制出的<strong>测验</strong>两个字上按顺序画上笔画</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>test-draw</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/13/2020, 4:46:50 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
};</code></pre></div> <h2 id="_3-常规绘制实例"><a href="#_3-常规绘制实例" class="header-anchor">#</a> 3. 常规绘制实例</h2> <p>绘制模式默认为常规模式 <code>type=normal</code></p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>normal-draw</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <h2 id="_4-笔顺绘制实例"><a href="#_4-笔顺绘制实例" class="header-anchor">#</a> 4. 笔顺绘制实例</h2> <p>当<code>type=stroke</code>时,笔顺模式启用,该模式会单笔绘制汉字的每一个笔划,并且为每一个笔划生成一个绘制块</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>stroke-draw</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <h2 id="_5-动画绘制模式"><a href="#_5-动画绘制模式" class="header-anchor">#</a> 5. 动画绘制模式</h2> <p>当<code>type=animation</code>时,动画模式启用,该模式会按笔顺用动画绘制每一个笔划</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>animation-draw</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <h2 id="_6-测验模式"><a href="#_6-测验模式" class="header-anchor">#</a> 6. 测验模式</h2> <p>当<code>type=test</code>时,测验模式启用,该模式用户可以在容器内绘制汉字,cnchar-draw会检测是否绘制正确</p> <p>请用鼠标在绘制出的<strong>测验</strong>两个字上按顺序画上笔画</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>test-draw</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/13/2020, 4:46:50 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/cnchar/v2/doc/trad.html" class="prev">
|
||||
cnchar-trad
|
||||
</a></span> <!----></p></div> </main></div><div class="global-ui"><!----><div></div></div></div>
|
||||
<script src="/cnchar/v2/assets/js/app.024b3107.js" defer></script><script src="/cnchar/v2/assets/js/2.5180ea63.js" defer></script><script src="/cnchar/v2/assets/js/11.a2eec2e7.js" defer></script><script src="/cnchar/v2/assets/js/3.f58208b0.js" defer></script>
|
||||
<script src="/cnchar/v2/assets/js/app.810c9b70.js" defer></script><script src="/cnchar/v2/assets/js/2.aecccbc9.js" defer></script><script src="/cnchar/v2/assets/js/11.a2eec2e7.js" defer></script><script src="/cnchar/v2/assets/js/3.8c8d8cb2.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<meta name="generator" content="VuePress 1.4.0">
|
||||
<link rel="icon" href="https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/v1/images/i.ico">
|
||||
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.024b3107.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.5180ea63.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/9.594cdfde.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.941af31d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.30e2dc9c.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.f192de8f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.48f87de9.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.15effdce.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/3.f58208b0.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.8bbe7e50.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css">
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.9898ab08.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.810c9b70.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.aecccbc9.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/9.594cdfde.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.ab53158a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.8edf06e3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.be7b0b94.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.a3e47921.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.eb7f4709.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/3.8c8d8cb2.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.dd3fb50d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.9898ab08.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/cnchar/v2/" class="home-link router-link-active"><!----> <span class="site-name">cnchar</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/cnchar/v2/" class="nav-link">
|
||||
|
@ -57,6 +57,6 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="https://blog.csdn.net/yanxiaomu" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
CSDN账号
|
||||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>cnchar文档</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/cnchar/v2/doc/cnchar.html" class="sidebar-link">cnchar</a></li><li><a href="/cnchar/v2/doc/poly.html" class="sidebar-link">cnchar-poly</a></li><li><a href="/cnchar/v2/doc/order.html" class="sidebar-link">cnchar-order</a></li><li><a href="/cnchar/v2/doc/trad.html" class="sidebar-link">cnchar-trad</a></li><li><a href="/cnchar/v2/doc/draw.html" class="sidebar-link">cnchar-draw</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="组件说明"><a href="#组件说明" class="header-anchor">#</a> 组件说明</h1></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/10/2020, 12:11:14 AM</span></div></footer> <!----> </main></div><div class="global-ui"><!----><div></div></div></div>
|
||||
<script src="/cnchar/v2/assets/js/app.024b3107.js" defer></script><script src="/cnchar/v2/assets/js/2.5180ea63.js" defer></script><script src="/cnchar/v2/assets/js/9.594cdfde.js" defer></script>
|
||||
<script src="/cnchar/v2/assets/js/app.810c9b70.js" defer></script><script src="/cnchar/v2/assets/js/2.aecccbc9.js" defer></script><script src="/cnchar/v2/assets/js/9.594cdfde.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<meta name="generator" content="VuePress 1.4.0">
|
||||
<link rel="icon" href="https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/v1/images/i.ico">
|
||||
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.024b3107.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.5180ea63.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/12.941af31d.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/3.f58208b0.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.30e2dc9c.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.f192de8f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.48f87de9.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.15effdce.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.8bbe7e50.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css">
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.9898ab08.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.810c9b70.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.aecccbc9.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/12.ab53158a.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/3.8c8d8cb2.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.8edf06e3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.be7b0b94.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.a3e47921.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.eb7f4709.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.dd3fb50d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.9898ab08.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/cnchar/v2/" class="home-link router-link-active"><!----> <span class="site-name">cnchar</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/cnchar/v2/" class="nav-link">
|
||||
|
@ -59,10 +59,10 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>cnchar文档</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/cnchar/v2/doc/cnchar.html" class="sidebar-link">cnchar</a></li><li><a href="/cnchar/v2/doc/poly.html" class="sidebar-link">cnchar-poly</a></li><li><a href="/cnchar/v2/doc/order.html" class="active sidebar-link">cnchar-order</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/order.html#_1-介绍" class="sidebar-link">1. 介绍</a></li><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/order.html#_2-stroke参数" class="sidebar-link">2. stroke参数</a></li><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/order.html#_3-实例" class="sidebar-link">3. 实例</a></li><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/order.html#_4-笔画推出原汉字-ordertoword" class="sidebar-link">4. 笔画推出原汉字(orderToWord)</a></li></ul></li><li><a href="/cnchar/v2/doc/trad.html" class="sidebar-link">cnchar-trad</a></li><li><a href="/cnchar/v2/doc/draw.html" class="sidebar-link">cnchar-draw</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h2 id="_1-介绍"><a href="#_1-介绍" class="header-anchor">#</a> 1. 介绍</h2> <p><code>cnchar-order</code> 库是用于支持获取汉字笔顺及其名称、形状,除此之外,该库还提供一个<code>orderToWord</code>方法,可以根据笔画序列推出原汉字,以及提供一个汉字所有笔划的json属性</p> <p>引入该库之后,<code>cnchar.stroke()</code> 方法才会支持 <code>order</code> 等参数</p> <p>npm安装</p> <div class="language- extra-class"><pre class="language-text"><code>npm i cnchar-order
|
||||
</code></pre></div><p>cdn使用</p> <div><pre><code class="hljs html"><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/cnchar-order/cnchar.order.min.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre></div> <p>使用</p> <div><pre><code class="hljs javascript"><span class="hljs-keyword">import</span> cnchar <span class="hljs-keyword">from</span> <span class="hljs-string">'cnchar'</span>;
|
||||
<span class="hljs-keyword">import</span> order <span class="hljs-keyword">from</span> <span class="hljs-string">'cnchar-order'</span>;
|
||||
cnchar.use(order); <span class="hljs-comment">// use 在浏览器环境中非必须</span></code></pre></div> <h2 id="_2-stroke参数"><a href="#_2-stroke参数" class="header-anchor">#</a> 2. stroke参数</h2> <table><thead><tr><th style="text-align:center;">参数</th> <th style="text-align:center;">作用</th> <th style="text-align:center;">是否默认</th> <th style="text-align:center;">依赖库</th> <th style="text-align:center;">备注</th></tr></thead> <tbody><tr><td style="text-align:center;">array</td> <td style="text-align:center;">返回数组</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">使用 cnchar-order 且启用 order 参数后该参数被忽略</td></tr> <tr><td style="text-align:center;">order</td> <td style="text-align:center;">启用笔画顺序</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">letter</td> <td style="text-align:center;">使用笔画顺序字母序列</td> <td style="text-align:center;">是</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">当启用 order 后,该值是默认值</td></tr> <tr><td style="text-align:center;">detail</td> <td style="text-align:center;">使用笔画顺序详情作为返回值,每个汉字对应一个 json</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">优先级小于 letter</td></tr> <tr><td style="text-align:center;">shape</td> <td style="text-align:center;">使用笔画形状作为返回值</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">优先级小于 detail</td></tr> <tr><td style="text-align:center;">name</td> <td style="text-align:center;">使用笔画名称作为返回值</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">优先级小于 shape</td></tr> <tr><td style="text-align:center;">count</td> <td style="text-align:center;">使用笔画数作为返回值</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-poly</td> <td style="text-align:center;">优先级小于 name</td></tr> <tr><td style="text-align:center;">simple</td> <td style="text-align:center;">是否禁用繁体字的笔画功能</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-trad</td> <td style="text-align:center;">使用 cnchar-trad 之后,默认对繁体字启用笔画功能,该参数用于禁用繁体字笔画功能</td></tr></tbody></table> <p>以上五种模式优先级为 <strong>letter < detail < shape < name < count</strong></p> <h2 id="_3-实例"><a href="#_3-实例" class="header-anchor">#</a> 3. 实例</h2> <p>以下演示几个多音词的例子</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>order</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <p>笔划形状模式(shape)由于系统原因,某些形状字符在 ios和macos上无法显示</p> <h2 id="_4-笔画推出原汉字-ordertoword"><a href="#_4-笔画推出原汉字-ordertoword" class="header-anchor">#</a> 4. 笔画推出原汉字(orderToWord)</h2> <h3 id="_4-1-使用"><a href="#_4-1-使用" class="header-anchor">#</a> 4.1 使用</h3> <p>当引入 <code>cnchar-order</code> 功能库(版本 2.0.2 及以上)之后,cnchar 就支持了根据笔画名称序列推出原汉字的功能,使用方式如下:</p> <div><pre><code class="hljs javascript">cnchar.orderToWord(orderNames[,...args]);</code></pre></div> <p><code>orderNames</code> 是笔画名称序列, 可以是空格分隔的笔画名称字符串或笔画名称数组</p> <p><code>args</code> 是参数列表,可选值有 <code>['match','matchorder','contain','start','array','simple']</code>, 使用 <code>cnchar.type.orderToWord</code> 可以查看可选值, 详情请见 4.2</p> <p>以下是一个简单的使用实例:</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>orderToWord</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <h3 id="_4-2-参数详情"><a href="#_4-2-参数详情" class="header-anchor">#</a> 4.2 参数详情</h3> <p>参数调用如下,所有 arg 参数都是可选的</p> <div><pre><code class="hljs javascript">cnchar.orderToWord(orders,arg1,arg2,...);</code></pre></div> <p>arg 参数信息如下:</p> <table><thead><tr><th style="text-align:center;">参数</th> <th style="text-align:center;">作用</th> <th style="text-align:center;">是否默认</th> <th style="text-align:center;">依赖库</th> <th style="text-align:center;">备注</th></tr></thead> <tbody><tr><td style="text-align:center;">match</td> <td style="text-align:center;">匹配含有笔序中所有笔画的汉字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">matchorder</td> <td style="text-align:center;">匹配含有笔序中所有笔画的汉字前先后顺序一致</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">contain</td> <td style="text-align:center;">匹配含有该笔序的汉字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">start</td> <td style="text-align:center;">匹配所有以该笔序开头的汉字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">array</td> <td style="text-align:center;">数组分割,默认返回的是字符串</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">simple</td> <td style="text-align:center;">只查询简体字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-trad</td> <td style="text-align:center;">该参数仅在引入了 <code>cnchar-trad</code> 后有效</td></tr> <tr><td style="text-align:center;">trad</td> <td style="text-align:center;">只查询繁体字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-trad</td> <td style="text-align:center;">该参数仅在引入了 <code>cnchar-trad</code> 后有效</td></tr></tbody></table> <p>关于匹配参数,优先级为 <strong>match > matchorder > contain > start > 默认</strong></p> <p>不含有匹配参数时表示使用全匹配,即汉字笔画数与传入的 orders 完全一致</p> <h3 id="_4-3-汉字所有笔划-ordertoword-orders"><a href="#_4-3-汉字所有笔划-ordertoword-orders" class="header-anchor">#</a> 4.3 汉字所有笔划(orderToWord.orders)</h3> <p>可用的笔画名称可以通过以下 api 查看</p> <p>orderNames 只需要传入笔画名称即可,也就是下面 json 数据的 key 值</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>orders</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <p>注:其中以下五对笔画没有进行区分,使用的是同样的字母表示:
|
||||
cnchar.use(order); <span class="hljs-comment">// use 在浏览器环境中非必须</span></code></pre></div> <h2 id="_2-stroke参数"><a href="#_2-stroke参数" class="header-anchor">#</a> 2. stroke参数</h2> <table><thead><tr><th style="text-align:center;">参数</th> <th style="text-align:center;">作用</th> <th style="text-align:center;">是否默认</th> <th style="text-align:center;">依赖库</th> <th style="text-align:center;">备注</th></tr></thead> <tbody><tr><td style="text-align:center;">array</td> <td style="text-align:center;">返回数组</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">使用 cnchar-order 且启用 order 参数后该参数被忽略</td></tr> <tr><td style="text-align:center;">order</td> <td style="text-align:center;">启用笔画顺序</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">letter</td> <td style="text-align:center;">使用笔画顺序字母序列</td> <td style="text-align:center;">是</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">当启用 order 后,该值是默认值</td></tr> <tr><td style="text-align:center;">detail</td> <td style="text-align:center;">使用笔画顺序详情作为返回值,每个汉字对应一个 json</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">优先级小于 letter</td></tr> <tr><td style="text-align:center;">shape</td> <td style="text-align:center;">使用笔画形状作为返回值</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">优先级小于 detail</td></tr> <tr><td style="text-align:center;">name</td> <td style="text-align:center;">使用笔画名称作为返回值</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-order</td> <td style="text-align:center;">优先级小于 shape</td></tr> <tr><td style="text-align:center;">count</td> <td style="text-align:center;">使用笔画数作为返回值</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-poly</td> <td style="text-align:center;">优先级小于 name</td></tr> <tr><td style="text-align:center;">simple</td> <td style="text-align:center;">是否禁用繁体字的笔画功能</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-trad</td> <td style="text-align:center;">使用 cnchar-trad 之后,默认对繁体字启用笔画功能,该参数用于禁用繁体字笔画功能</td></tr></tbody></table> <p>以上五种模式优先级为 <strong>letter < detail < shape < name < count</strong></p> <h2 id="_3-实例"><a href="#_3-实例" class="header-anchor">#</a> 3. 实例</h2> <p>以下演示几个多音词的例子</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>order</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <p>笔划形状模式(shape)由于系统原因,某些形状字符在 ios和macos上无法显示</p> <h2 id="_4-笔画推出原汉字-ordertoword"><a href="#_4-笔画推出原汉字-ordertoword" class="header-anchor">#</a> 4. 笔画推出原汉字(orderToWord)</h2> <h3 id="_4-1-使用"><a href="#_4-1-使用" class="header-anchor">#</a> 4.1 使用</h3> <p>当引入 <code>cnchar-order</code> 功能库(版本 2.0.2 及以上)之后,cnchar 就支持了根据笔画名称序列推出原汉字的功能,使用方式如下:</p> <div><pre><code class="hljs javascript">cnchar.orderToWord(orderNames[,...args]);</code></pre></div> <p><code>orderNames</code> 是笔画名称序列, 可以是空格分隔的笔画名称字符串或笔画名称数组</p> <p><code>args</code> 是参数列表,可选值有 <code>['match','matchorder','contain','start','array','simple']</code>, 使用 <code>cnchar.type.orderToWord</code> 可以查看可选值, 详情请见 4.2</p> <p>以下是一个简单的使用实例:</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>orderToWord</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <h3 id="_4-2-参数详情"><a href="#_4-2-参数详情" class="header-anchor">#</a> 4.2 参数详情</h3> <p>参数调用如下,所有 arg 参数都是可选的</p> <div><pre><code class="hljs javascript">cnchar.orderToWord(orders,arg1,arg2,...);</code></pre></div> <p>arg 参数信息如下:</p> <table><thead><tr><th style="text-align:center;">参数</th> <th style="text-align:center;">作用</th> <th style="text-align:center;">是否默认</th> <th style="text-align:center;">依赖库</th> <th style="text-align:center;">备注</th></tr></thead> <tbody><tr><td style="text-align:center;">match</td> <td style="text-align:center;">匹配含有笔序中所有笔画的汉字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">matchorder</td> <td style="text-align:center;">匹配含有笔序中所有笔画的汉字前先后顺序一致</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">contain</td> <td style="text-align:center;">匹配含有该笔序的汉字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">start</td> <td style="text-align:center;">匹配所有以该笔序开头的汉字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">array</td> <td style="text-align:center;">数组分割,默认返回的是字符串</td> <td style="text-align:center;">否</td> <td style="text-align:center;">--</td> <td style="text-align:center;">--</td></tr> <tr><td style="text-align:center;">simple</td> <td style="text-align:center;">只查询简体字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-trad</td> <td style="text-align:center;">该参数仅在引入了 <code>cnchar-trad</code> 后有效</td></tr> <tr><td style="text-align:center;">trad</td> <td style="text-align:center;">只查询繁体字</td> <td style="text-align:center;">否</td> <td style="text-align:center;">cnchar-trad</td> <td style="text-align:center;">该参数仅在引入了 <code>cnchar-trad</code> 后有效</td></tr></tbody></table> <p>关于匹配参数,优先级为 <strong>match > matchorder > contain > start > 默认</strong></p> <p>不含有匹配参数时表示使用全匹配,即汉字笔画数与传入的 orders 完全一致</p> <h3 id="_4-3-汉字所有笔划-ordertoword-orders"><a href="#_4-3-汉字所有笔划-ordertoword-orders" class="header-anchor">#</a> 4.3 汉字所有笔划(orderToWord.orders)</h3> <p>可用的笔画名称可以通过以下 api 查看</p> <p>orderNames 只需要传入笔画名称即可,也就是下面 json 数据的 key 值</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>orders</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <p>注:其中以下五对笔画没有进行区分,使用的是同样的字母表示:
|
||||
<strong>卧钩 = 斜钩</strong>、<strong>横折弯 = 横折折</strong>、<strong>横折折折钩 = 横撇弯钩</strong>、<strong>横撇 = 横钩</strong>、<strong>竖折折 = 竖折撇</strong></p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/12/2020, 10:44:57 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/cnchar/v2/doc/poly.html" class="prev">
|
||||
|
@ -72,6 +72,6 @@ cnchar.use(order); <span class="hljs-comment">// use 在浏览器环境中非必
|
|||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"><!----><div></div></div></div>
|
||||
<script src="/cnchar/v2/assets/js/app.024b3107.js" defer></script><script src="/cnchar/v2/assets/js/2.5180ea63.js" defer></script><script src="/cnchar/v2/assets/js/12.941af31d.js" defer></script><script src="/cnchar/v2/assets/js/3.f58208b0.js" defer></script>
|
||||
<script src="/cnchar/v2/assets/js/app.810c9b70.js" defer></script><script src="/cnchar/v2/assets/js/2.aecccbc9.js" defer></script><script src="/cnchar/v2/assets/js/12.ab53158a.js" defer></script><script src="/cnchar/v2/assets/js/3.8c8d8cb2.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<meta name="generator" content="VuePress 1.4.0">
|
||||
<link rel="icon" href="https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/v1/images/i.ico">
|
||||
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.024b3107.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.5180ea63.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/13.30e2dc9c.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/3.f58208b0.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.941af31d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.f192de8f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.48f87de9.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.15effdce.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.8bbe7e50.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css">
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.9898ab08.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.810c9b70.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.aecccbc9.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/13.8edf06e3.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/3.8c8d8cb2.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.ab53158a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.be7b0b94.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.a3e47921.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.eb7f4709.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.dd3fb50d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.9898ab08.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/cnchar/v2/" class="home-link router-link-active"><!----> <span class="site-name">cnchar</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/cnchar/v2/" class="nav-link">
|
||||
|
@ -59,8 +59,8 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>cnchar文档</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/cnchar/v2/doc/cnchar.html" class="sidebar-link">cnchar</a></li><li><a href="/cnchar/v2/doc/poly.html" class="active sidebar-link">cnchar-poly</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/poly.html#_1-介绍" class="sidebar-link">1. 介绍</a></li><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/poly.html#_2-实例" class="sidebar-link">2. 实例</a></li></ul></li><li><a href="/cnchar/v2/doc/order.html" class="sidebar-link">cnchar-order</a></li><li><a href="/cnchar/v2/doc/trad.html" class="sidebar-link">cnchar-trad</a></li><li><a href="/cnchar/v2/doc/draw.html" class="sidebar-link">cnchar-draw</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h2 id="_1-介绍"><a href="#_1-介绍" class="header-anchor">#</a> 1. 介绍</h2> <p><code>cnchar-poly</code> 库是用于支持多音词的库,该库本身并不提供新的api</p> <p>引入该库之后,<code>cnchar.spell()</code> 方法才会支持多音词,否则对于多音字会返回默认读音</p> <p>npm安装</p> <div class="language- extra-class"><pre class="language-text"><code>npm i cnchar-poly
|
||||
</code></pre></div><p>cdn使用</p> <div><pre><code class="hljs html"><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/cnchar-poly/cnchar.poly.min.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre></div> <p>使用</p> <div><pre><code class="hljs javascript"><span class="hljs-keyword">import</span> cnchar <span class="hljs-keyword">from</span> <span class="hljs-string">'cnchar'</span>;
|
||||
<span class="hljs-keyword">import</span> poly <span class="hljs-keyword">from</span> <span class="hljs-string">'cnchar-poly'</span>;
|
||||
cnchar.use(poly); <span class="hljs-comment">// use 在浏览器环境中非必须</span></code></pre></div> <h2 id="_2-实例"><a href="#_2-实例" class="header-anchor">#</a> 2. 实例</h2> <p>以下演示几个多音词的例子</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>poly</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <p>由于多音词依赖分词与词库,且cnchar是一个静态的js库,所以可能会有诸多不准确的读音</p> <p>如果遇到不准缺的多音词,欢迎提<a href="https://github.com/theajack/cnchar/issues/new" target="_blank" rel="noopener noreferrer">issue或pr<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/12/2020, 10:44:57 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
cnchar.use(poly); <span class="hljs-comment">// use 在浏览器环境中非必须</span></code></pre></div> <h2 id="_2-实例"><a href="#_2-实例" class="header-anchor">#</a> 2. 实例</h2> <p>以下演示几个多音词的例子</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>poly</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <p>由于多音词依赖分词与词库,且cnchar是一个静态的js库,所以可能会有诸多不准确的读音</p> <p>如果遇到不准缺的多音词,欢迎提<a href="https://github.com/theajack/cnchar/issues/new" target="_blank" rel="noopener noreferrer">issue或pr<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/12/2020, 10:44:57 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/cnchar/v2/doc/cnchar.html" class="prev">
|
||||
cnchar
|
||||
|
@ -69,6 +69,6 @@ cnchar.use(poly); <span class="hljs-comment">// use 在浏览器环境中非必
|
|||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"><!----><div></div></div></div>
|
||||
<script src="/cnchar/v2/assets/js/app.024b3107.js" defer></script><script src="/cnchar/v2/assets/js/2.5180ea63.js" defer></script><script src="/cnchar/v2/assets/js/13.30e2dc9c.js" defer></script><script src="/cnchar/v2/assets/js/3.f58208b0.js" defer></script>
|
||||
<script src="/cnchar/v2/assets/js/app.810c9b70.js" defer></script><script src="/cnchar/v2/assets/js/2.aecccbc9.js" defer></script><script src="/cnchar/v2/assets/js/13.8edf06e3.js" defer></script><script src="/cnchar/v2/assets/js/3.8c8d8cb2.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<meta name="generator" content="VuePress 1.4.0">
|
||||
<link rel="icon" href="https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/v1/images/i.ico">
|
||||
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.024b3107.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.5180ea63.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/14.f192de8f.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/3.f58208b0.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.941af31d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.30e2dc9c.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.48f87de9.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.15effdce.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.8bbe7e50.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css">
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.9898ab08.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.810c9b70.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.aecccbc9.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/14.be7b0b94.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/3.8c8d8cb2.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.ab53158a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.8edf06e3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.a3e47921.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.eb7f4709.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.dd3fb50d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.9898ab08.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/cnchar/v2/" class="home-link router-link-active"><!----> <span class="site-name">cnchar</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/cnchar/v2/" class="nav-link">
|
||||
|
@ -59,8 +59,8 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>cnchar文档</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/cnchar/v2/doc/cnchar.html" class="sidebar-link">cnchar</a></li><li><a href="/cnchar/v2/doc/poly.html" class="sidebar-link">cnchar-poly</a></li><li><a href="/cnchar/v2/doc/order.html" class="sidebar-link">cnchar-order</a></li><li><a href="/cnchar/v2/doc/trad.html" class="active sidebar-link">cnchar-trad</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/trad.html#_1-介绍" class="sidebar-link">1. 介绍</a></li><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/trad.html#_2-繁体字支持" class="sidebar-link">2. 繁体字支持</a></li><li class="sidebar-sub-header"><a href="/cnchar/v2/doc/trad.html#_3-字体转换-convert" class="sidebar-link">3. 字体转换(convert)</a></li></ul></li><li><a href="/cnchar/v2/doc/draw.html" class="sidebar-link">cnchar-draw</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h2 id="_1-介绍"><a href="#_1-介绍" class="header-anchor">#</a> 1. 介绍</h2> <p><code>cnchar-trad</code> 库是用于繁体字,除此之外,该库还提供繁体、简体、火星文之间的相互转换</p> <p>引入该库之后,cnchar的所有api都支持 <code>simple</code>和<code>trad</code>参数,用于只使用简体或繁体,默认两种字体都使用</p> <p>npm安装</p> <div class="language- extra-class"><pre class="language-text"><code>npm i cnchar-trad
|
||||
</code></pre></div><p>cdn使用</p> <div><pre><code class="hljs html"><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/cnchar-trad/cnchar.trad.min.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre></div> <p>使用</p> <div><pre><code class="hljs javascript"><span class="hljs-keyword">import</span> cnchar <span class="hljs-keyword">from</span> <span class="hljs-string">'cnchar'</span>;
|
||||
<span class="hljs-keyword">import</span> trad <span class="hljs-keyword">from</span> <span class="hljs-string">'cnchar-trad'</span>;
|
||||
cnchar.use(trad); <span class="hljs-comment">// use 在浏览器环境中非必须</span></code></pre></div> <h2 id="_2-繁体字支持"><a href="#_2-繁体字支持" class="header-anchor">#</a> 2. 繁体字支持</h2> <p>以下演示几个繁体字支持的例子</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>trad</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <h2 id="_3-字体转换-convert"><a href="#_3-字体转换-convert" class="header-anchor">#</a> 3. 字体转换(convert)</h2> <p>引入 cnchar-trad 库之后,在cnchar上会生成一个 <code>convert</code> 对象,功能是支持字体转换,另外在string.prototype 上也会附加上对应的方法,用法如下:</p> <div><pre><code class="hljs javascript">cnchar.convert.simpleToTrad(string); <span class="hljs-comment">// 简体 => 繁体</span>
|
||||
cnchar.use(trad); <span class="hljs-comment">// use 在浏览器环境中非必须</span></code></pre></div> <h2 id="_2-繁体字支持"><a href="#_2-繁体字支持" class="header-anchor">#</a> 2. 繁体字支持</h2> <p>以下演示几个繁体字支持的例子</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>trad</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <h2 id="_3-字体转换-convert"><a href="#_3-字体转换-convert" class="header-anchor">#</a> 3. 字体转换(convert)</h2> <p>引入 cnchar-trad 库之后,在cnchar上会生成一个 <code>convert</code> 对象,功能是支持字体转换,另外在string.prototype 上也会附加上对应的方法,用法如下:</p> <div><pre><code class="hljs javascript">cnchar.convert.simpleToTrad(string); <span class="hljs-comment">// 简体 => 繁体</span>
|
||||
cnchar.convert.simpleToSpark(string); <span class="hljs-comment">// 简体 => 火星文</span>
|
||||
cnchar.convert.tradToSimple(string); <span class="hljs-comment">// 繁体 => 简体</span>
|
||||
cnchar.convert.tradToSpark(string); <span class="hljs-comment">// 繁体 => 火星文</span>
|
||||
|
@ -71,8 +71,8 @@ string.convertSimpleToSpark();
|
|||
string.convertTradToSimple();
|
||||
string.convertTradToSpark();
|
||||
string.convertSparkToSimple();
|
||||
string.convertSparkToTrad();</code></pre></div> <p>以下是几个实例:</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>convert</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/12/2020, 10:44:57 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
string.convertSparkToTrad();</code></pre></div> <p>以下是几个实例:</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>convert</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/12/2020, 10:44:57 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/cnchar/v2/doc/order.html" class="prev">
|
||||
cnchar-order
|
||||
|
@ -81,6 +81,6 @@ string.convertSparkToTrad();</code></pre></div> <p>以下是几个实例:</p>
|
|||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"><!----><div></div></div></div>
|
||||
<script src="/cnchar/v2/assets/js/app.024b3107.js" defer></script><script src="/cnchar/v2/assets/js/2.5180ea63.js" defer></script><script src="/cnchar/v2/assets/js/14.f192de8f.js" defer></script><script src="/cnchar/v2/assets/js/3.f58208b0.js" defer></script>
|
||||
<script src="/cnchar/v2/assets/js/app.810c9b70.js" defer></script><script src="/cnchar/v2/assets/js/2.aecccbc9.js" defer></script><script src="/cnchar/v2/assets/js/14.be7b0b94.js" defer></script><script src="/cnchar/v2/assets/js/3.8c8d8cb2.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<meta name="generator" content="VuePress 1.4.0">
|
||||
<link rel="icon" href="https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/v1/images/i.ico">
|
||||
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.024b3107.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.5180ea63.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/15.589ef773.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/5.d0225f93.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.941af31d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.30e2dc9c.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.f192de8f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.48f87de9.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.15effdce.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/3.f58208b0.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.8bbe7e50.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css">
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.9898ab08.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.810c9b70.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.aecccbc9.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/15.589ef773.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/5.d0225f93.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.ab53158a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.8edf06e3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.be7b0b94.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.a3e47921.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.eb7f4709.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/3.8c8d8cb2.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.dd3fb50d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.9898ab08.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/cnchar/v2/" class="home-link router-link-active"><!----> <span class="site-name">cnchar</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/cnchar/v2/" class="nav-link">
|
||||
|
@ -61,6 +61,6 @@
|
|||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"><!----><div></div></div></div>
|
||||
<script src="/cnchar/v2/assets/js/app.024b3107.js" defer></script><script src="/cnchar/v2/assets/js/2.5180ea63.js" defer></script><script src="/cnchar/v2/assets/js/15.589ef773.js" defer></script><script src="/cnchar/v2/assets/js/5.d0225f93.js" defer></script>
|
||||
<script src="/cnchar/v2/assets/js/app.810c9b70.js" defer></script><script src="/cnchar/v2/assets/js/2.aecccbc9.js" defer></script><script src="/cnchar/v2/assets/js/15.589ef773.js" defer></script><script src="/cnchar/v2/assets/js/5.d0225f93.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<meta name="generator" content="VuePress 1.4.0">
|
||||
<link rel="icon" href="https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/v1/images/i.ico">
|
||||
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.024b3107.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.5180ea63.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/16.48f87de9.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/3.f58208b0.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.941af31d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.30e2dc9c.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.f192de8f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.15effdce.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.8bbe7e50.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css">
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.9898ab08.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.810c9b70.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.aecccbc9.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/16.a3e47921.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/3.8c8d8cb2.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.ab53158a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.8edf06e3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.be7b0b94.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.eb7f4709.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.dd3fb50d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.9898ab08.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/cnchar/v2/" class="home-link router-link-active"><!----> <span class="site-name">cnchar</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/cnchar/v2/" class="nav-link">
|
||||
|
@ -79,8 +79,8 @@ cnchar.use(poly, order, trad);</code></pre></div> <h2 id="_2-cdn引用"><a href=
|
|||
<span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/cnchar-order/cnchar.order.min.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/cnchar-trad/cnchar.trad.min.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span>
|
||||
<span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/cnchar-draw/cnchar.draw.min.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre></div> <h2 id="_3-cnchar-all"><a href="#_3-cnchar-all" class="header-anchor">#</a> 3. cnchar-all</h2> <p>如果您需要使用cnchar及其插件的所有功能,可以通过安装<code>cnchar-all</code>来使用完整功能,这个库引用了上面的五个库</p> <div class="language- extra-class"><pre class="language-text"><code>npm i cnchar-all
|
||||
</code></pre></div><p>commonjs 模块</p> <div><pre><code class="hljs javascript"><span class="hljs-keyword">import</span> cnchar <span class="hljs-keyword">from</span> <span class="hljs-string">'cnchar-all'</span>;</code></pre></div> <p>cdn方式</p> <div><pre><code class="hljs html"><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/cnchar-all/cnchar.all.min.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre></div> <h2 id="_4-简单使用"><a href="#_4-简单使用" class="header-anchor">#</a> 4. 简单使用</h2> <p>cnchar 具有两个最核心的方法<code>spell</code> 和 <code>stroke</code>,分别用于获取汉字的拼音和笔画数:</p> <p><div class="code-box" data-v-2bee2b1c><div data-v-2bee2b1c><span class="code-title" data-v-2bee2b1c>spell/stroke</span> <span class="code-desc" data-v-2bee2b1c></span> <i title="在线运行" class="ei-play code-btn" data-v-2bee2b1c></i> <i title="复制代码" class="ei-copy code-btn" data-v-2bee2b1c></i></div> <pre data-v-2bee2b1c><code class="hljs"></code></pre> <div style="display:none;" data-v-2bee2b1c><div class="output-title" data-v-2bee2b1c>运行结果</div> <div class="output-area" data-v-2bee2b1c><div class="show-toggle" data-v-2bee2b1c><i class="ei-angle-up" data-v-2bee2b1c></i> <span class="show-text" data-v-2bee2b1c>隐藏结果</span></div> <div style="display:;" data-v-2bee2b1c></div></div></div> <div class="powered-by" data-v-2bee2b1c>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-2bee2b1c><i class="ei-cube-alt" data-v-2bee2b1c></i> JSBox</a></div></div></p> <p>这只是一个最简单的使用,这两个方法具有很多参数可选,具体请参阅 <a href="">cnchar</a> 部分</p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/12/2020, 10:44:57 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
</code></pre></div><p>commonjs 模块</p> <div><pre><code class="hljs javascript"><span class="hljs-keyword">import</span> cnchar <span class="hljs-keyword">from</span> <span class="hljs-string">'cnchar-all'</span>;</code></pre></div> <p>cdn方式</p> <div><pre><code class="hljs html"><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/cnchar-all/cnchar.all.min.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre></div> <h2 id="_4-简单使用"><a href="#_4-简单使用" class="header-anchor">#</a> 4. 简单使用</h2> <p>cnchar 具有两个最核心的方法<code>spell</code> 和 <code>stroke</code>,分别用于获取汉字的拼音和笔画数:</p> <p><div class="code-box" data-v-754a03aa><div data-v-754a03aa><span class="code-title" data-v-754a03aa>spell/stroke</span> <span class="code-desc" data-v-754a03aa></span> <i title="在线运行" class="ei-play code-btn" data-v-754a03aa></i> <i title="复制代码" class="ei-copy code-btn" data-v-754a03aa></i></div> <pre data-v-754a03aa><code class="hljs"></code></pre> <div style="display:none;" data-v-754a03aa><div class="output-title" data-v-754a03aa>运行结果</div> <div class="output-area" data-v-754a03aa><div class="show-toggle" data-v-754a03aa><i class="ei-angle-up" data-v-754a03aa></i> <span class="show-text" data-v-754a03aa>隐藏结果</span></div> <div style="display:;" data-v-754a03aa></div></div></div> <div class="powered-by" data-v-754a03aa>
|
||||
Powered by <a target="view_window" href="https://github.com/theajack/jsbox" class="jsbox-link" data-v-754a03aa><i class="ei-cube-alt" data-v-754a03aa></i> JSBox</a></div></div></p> <p>这只是一个最简单的使用,这两个方法具有很多参数可选,具体请参阅 <a href="">cnchar</a> 部分</p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/12/2020, 10:44:57 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/cnchar/v2/guide/" class="prev router-link-active">
|
||||
简介
|
||||
|
@ -89,6 +89,6 @@ cnchar.use(poly, order, trad);</code></pre></div> <h2 id="_2-cdn引用"><a href=
|
|||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"><!----><div></div></div></div>
|
||||
<script src="/cnchar/v2/assets/js/app.024b3107.js" defer></script><script src="/cnchar/v2/assets/js/2.5180ea63.js" defer></script><script src="/cnchar/v2/assets/js/16.48f87de9.js" defer></script><script src="/cnchar/v2/assets/js/3.f58208b0.js" defer></script>
|
||||
<script src="/cnchar/v2/assets/js/app.810c9b70.js" defer></script><script src="/cnchar/v2/assets/js/2.aecccbc9.js" defer></script><script src="/cnchar/v2/assets/js/16.a3e47921.js" defer></script><script src="/cnchar/v2/assets/js/3.8c8d8cb2.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<meta name="generator" content="VuePress 1.4.0">
|
||||
<link rel="icon" href="https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/v1/images/i.ico">
|
||||
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.024b3107.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.5180ea63.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/17.15effdce.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.941af31d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.30e2dc9c.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.f192de8f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.48f87de9.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/3.f58208b0.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.8bbe7e50.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css">
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.9898ab08.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.810c9b70.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.aecccbc9.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/17.eb7f4709.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.ab53158a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.8edf06e3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.be7b0b94.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.a3e47921.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/3.8c8d8cb2.js"><link rel="prefetch" href="/cnchar/v2/assets/js/4.dd3fb50d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/8.b666565e.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.9898ab08.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/cnchar/v2/" class="home-link router-link-active"><!----> <span class="site-name">cnchar</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/cnchar/v2/" class="nav-link">
|
||||
|
@ -61,6 +61,6 @@
|
|||
<a href="/cnchar/v2/guide/start.html" class="prev">
|
||||
快速上手
|
||||
</a></span> <!----></p></div> </main></div><div class="global-ui"><!----><div></div></div></div>
|
||||
<script src="/cnchar/v2/assets/js/app.024b3107.js" defer></script><script src="/cnchar/v2/assets/js/2.5180ea63.js" defer></script><script src="/cnchar/v2/assets/js/17.15effdce.js" defer></script>
|
||||
<script src="/cnchar/v2/assets/js/app.810c9b70.js" defer></script><script src="/cnchar/v2/assets/js/2.aecccbc9.js" defer></script><script src="/cnchar/v2/assets/js/17.eb7f4709.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<meta name="generator" content="VuePress 1.4.0">
|
||||
<link rel="icon" href="https://cdn.jsdelivr.net/gh/theajack/cnchar/docs/assets/v1/images/i.ico">
|
||||
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.024b3107.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.5180ea63.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/8.b666565e.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/4.8bbe7e50.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.941af31d.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.30e2dc9c.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.f192de8f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.48f87de9.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.15effdce.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/3.f58208b0.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.0454a2bb.css">
|
||||
<link rel="preload" href="/cnchar/v2/assets/css/0.styles.9898ab08.css" as="style"><link rel="preload" href="/cnchar/v2/assets/js/app.810c9b70.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/2.aecccbc9.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/8.b666565e.js" as="script"><link rel="preload" href="/cnchar/v2/assets/js/4.dd3fb50d.js" as="script"><link rel="prefetch" href="/cnchar/v2/assets/js/10.54779f86.js"><link rel="prefetch" href="/cnchar/v2/assets/js/11.a2eec2e7.js"><link rel="prefetch" href="/cnchar/v2/assets/js/12.ab53158a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/13.8edf06e3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/14.be7b0b94.js"><link rel="prefetch" href="/cnchar/v2/assets/js/15.589ef773.js"><link rel="prefetch" href="/cnchar/v2/assets/js/16.a3e47921.js"><link rel="prefetch" href="/cnchar/v2/assets/js/17.eb7f4709.js"><link rel="prefetch" href="/cnchar/v2/assets/js/18.0ef7fddd.js"><link rel="prefetch" href="/cnchar/v2/assets/js/19.1e1c376a.js"><link rel="prefetch" href="/cnchar/v2/assets/js/20.ee1779ab.js"><link rel="prefetch" href="/cnchar/v2/assets/js/21.3266f19f.js"><link rel="prefetch" href="/cnchar/v2/assets/js/3.8c8d8cb2.js"><link rel="prefetch" href="/cnchar/v2/assets/js/5.d0225f93.js"><link rel="prefetch" href="/cnchar/v2/assets/js/6.bc0a39d3.js"><link rel="prefetch" href="/cnchar/v2/assets/js/7.b65f14e4.js"><link rel="prefetch" href="/cnchar/v2/assets/js/9.594cdfde.js">
|
||||
<link rel="stylesheet" href="/cnchar/v2/assets/css/0.styles.9898ab08.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container no-sidebar"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/cnchar/v2/" class="home-link router-link-exact-active router-link-active"><!----> <span class="site-name">cnchar</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/cnchar/v2/" class="nav-link router-link-exact-active router-link-active">
|
||||
|
@ -57,6 +57,6 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="https://blog.csdn.net/yanxiaomu" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
CSDN账号
|
||||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div> <!----></nav> <!----> </aside> <main class="page"> <div class="theme-default-content content__default"><p><div class="home-wrapper"><div><img src="/cnchar/v2/assets/img/logo.6cd28633.png" alt srcset class="logo"></div> <div class="title">cnchar</div> <div class="desc">功能全面、多端支持的汉字拼音笔画js库</div> <div class="test"><div class="test-input el-input"><!----><input type="text" autocomplete="off" placeholder="输入一些汉字试试" class="el-input__inner"><!----><!----><!----><!----></div> <div class="show-area" style="display:none;"><div> <span class="split">|</span> 共笔</div> <div>繁体: <span class="split">|</span> 火星文: </div> <div>笔顺: </div> <div id="draw-area"></div></div></div> <div class="start-w"><button type="button" class="el-button el-button--primary"><!----><!----><span>开始 <i class="ei-location-arrow"></i></span></button></div> <div class="feature-w"><div class="f-i"><div class="f-t"><i class="ei-rocket"></i>功能全面</div> <div class="f-des">拼音、笔画数</div> <div class="f-des">多音字词</div> <div class="f-des">繁体字、火星文</div> <div class="f-des">汉字笔顺</div> <div class="f-des">多种模式绘制汉字</div> <div class="f-des">汉字推算</div> <div class="f-des">...</div></div> <div class="f-i"><div class="f-t"><i class="ei-tablet"></i>多端支持</div> <div class="f-des">浏览器</div> <div class="f-des">nodejs</div> <div class="f-des">小程序/小游戏</div> <div class="f-des">ReactNative/Weex/Uniapp/Electron</div> <div class="f-des">webpack</div> <div class="f-des">typescript支持</div> <div class="f-des">...</div></div> <div class="f-i"><div class="f-t"><i class="ei-cubes"></i>按需取用</div> <div class="f-des">功能分包</div> <div class="f-des">体积小巧</div> <div class="f-des">简单易用</div> <div class="f-des">npm</div> <div class="f-des">cdn</div></div></div> <div class="copy-right">MIT Licensed | Copyright © 2020 present <a href="https://www.github.com/theajack" target="view_window">theajack</a></div></div></p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/13/2020, 4:46:50 PM</span></div></footer> <!----> </main></div><div class="global-ui"><!----><div></div></div></div>
|
||||
<script src="/cnchar/v2/assets/js/app.024b3107.js" defer></script><script src="/cnchar/v2/assets/js/2.5180ea63.js" defer></script><script src="/cnchar/v2/assets/js/8.b666565e.js" defer></script><script src="/cnchar/v2/assets/js/4.8bbe7e50.js" defer></script>
|
||||
<script src="/cnchar/v2/assets/js/app.810c9b70.js" defer></script><script src="/cnchar/v2/assets/js/2.aecccbc9.js" defer></script><script src="/cnchar/v2/assets/js/8.b666565e.js" defer></script><script src="/cnchar/v2/assets/js/4.dd3fb50d.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue