doc.3ec23141.js 9.7 KB

1
  1. import{a as h,e as i,o as _,b as y,G as r,D as x,g as b,F as t,H as k,r as N,I as g,u as $,x as C,l as o,X as U}from"./@vue.e84e1286.js";import{p as f}from"./preview.2bfe2f00.js";import"./bus.f1893518.js";import"./mitt.550594b0.js";/* empty css */import"./index.c8cfbd6c.js";import"./vue-router.54876e93.js";const A=x("\u5907\u9009\u9879"),B={__name:"demo1",setup(V){const l=h(!0),n=c=>{console.log(c)};return(c,s)=>{const u=i("m-checkbox");return _(),y(u,{modelValue:l.value,"onUpdate:modelValue":s[0]||(s[0]=d=>l.value=d),onChange:n},{default:r(()=>[A]),_:1},8,["modelValue"])}}},E=x("\u5907\u9009\u9879"),G=x("\u5907\u9009\u9879"),D={__name:"demo2",setup(V){const l=h(!0),n=h(!1);return(c,s)=>{const u=i("m-checkbox");return _(),b(k,null,[t(u,{modelValue:l.value,"onUpdate:modelValue":s[0]||(s[0]=d=>l.value=d),disabled:""},{default:r(()=>[E]),_:1},8,["modelValue"]),t(u,{modelValue:n.value,"onUpdate:modelValue":s[1]||(s[1]=d=>n.value=d),disabled:""},{default:r(()=>[G]),_:1},8,["modelValue"])],64)}}},w={__name:"demo3",setup(V){const l=h(["\u590D\u9009\u6846 A","\u590D\u9009\u6846 E"]),n=h([]),c=N({checkOptions:[{label:"\u590D\u9009\u6846 A"},{label:"\u590D\u9009\u6846 B"},{label:"\u590D\u9009\u6846 C"},{label:"\u590D\u9009\u6846 D",disabled:!0},{label:"\u590D\u9009\u6846 E",disabled:!0}]}),s=d=>{console.log(d)},{checkOptions:u}=c;return(d,a)=>{const e=i("m-checkbox"),m=i("m-checkbox-group");return _(),b(k,null,[t(m,{modelValue:l.value,"onUpdate:modelValue":a[0]||(a[0]=v=>l.value=v),onChange:s},{default:r(()=>[t(e,{label:"\u590D\u9009\u6846 A"}),t(e,{label:"\u590D\u9009\u6846 B"}),t(e,{label:"\u590D\u9009\u6846 C"}),t(e,{label:"\u590D\u9009\u6846 D",disabled:""}),t(e,{label:"\u590D\u9009\u6846 E",disabled:""})]),_:1},8,["modelValue"]),t(m,{modelValue:n.value,"onUpdate:modelValue":a[1]||(a[1]=v=>n.value=v),style:{"margin-top":"10px"}},{default:r(()=>[(_(!0),b(k,null,g($(u),(v,p)=>(_(),y(e,{key:p,label:v.label,disabled:v.disabled},null,8,["label","disabled"]))),128))]),_:1},8,["modelValue"])],64)}}},L=x(" \u5168\u9009 "),F=o("div",{style:{margin:"10px 0"}},null,-1),I={__name:"demo4",setup(V){const l=["\u4E0A\u6D77","\u5317\u4EAC","\u5E7F\u5DDE","\u6DF1\u5733"],n=h(!1),c=h(!0),s=h(["\u4E0A\u6D77","\u5317\u4EAC"]),u=a=>{s.value=a?l:[],c.value=!1},d=a=>{const e=a.length;n.value=e===l.length,c.value=e>0&&e<l.length};return(a,e)=>{const m=i("m-checkbox"),v=i("m-checkbox-group");return _(),b(k,null,[t(m,{modelValue:n.value,"onUpdate:modelValue":e[0]||(e[0]=p=>n.value=p),indeterminate:c.value,onChange:u},{default:r(()=>[L]),_:1},8,["modelValue","indeterminate"]),F,t(v,{modelValue:s.value,"onUpdate:modelValue":e[1]||(e[1]=p=>s.value=p),onChange:d},{default:r(()=>[(_(),b(k,null,g(l,p=>t(m,{label:p,key:p},{default:r(()=>[x(C(p),1)]),_:2},1032,["label"])),64))]),_:1},8,["modelValue"])],64)}}},O={style:{"margin-top":"20px"}},S={__name:"demo5",setup(V){const l=h(["\u4E0A\u6D77"]),n=h(["\u4E0A\u6D77"]),c=["\u4E0A\u6D77","\u5317\u4EAC","\u5E7F\u5DDE","\u6DF1\u5733"];return(s,u)=>{const d=i("m-checkbox-button"),a=i("m-checkbox-group");return _(),b(k,null,[o("div",null,[t(a,{modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=e=>l.value=e)},{default:r(()=>[(_(),b(k,null,g(c,e=>t(d,{label:e,key:e},{default:r(()=>[x(C(e),1)]),_:2},1032,["label"])),64))]),_:1},8,["modelValue"])]),o("div",O,[t(a,{modelValue:n.value,"onUpdate:modelValue":u[1]||(u[1]=e=>n.value=e)},{default:r(()=>[(_(),b(k,null,g(c,e=>t(d,{label:e,key:e,disabled:e==="\u5317\u4EAC"},{default:r(()=>[x(C(e),1)]),_:2},1032,["label","disabled"])),64))]),_:1},8,["modelValue"])])],64)}}},H=x("\u5907\u9009\u98791"),T=x("\u5907\u9009\u98792"),X={style:{"margin-top":"20px"}},j={style:{"margin-top":"20px"}},q={__name:"demo6",setup(V){const l=h(!0),n=h(!1),c=h(["\u5907\u9009\u98791"]),s=h([]);return(u,d)=>{const a=i("m-checkbox"),e=i("m-checkbox-group");return _(),b(k,null,[o("div",null,[t(a,{modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=m=>l.value=m),border:""},{default:r(()=>[H]),_:1},8,["modelValue"]),t(a,{modelValue:n.value,"onUpdate:modelValue":d[1]||(d[1]=m=>n.value=m),border:""},{default:r(()=>[T]),_:1},8,["modelValue"])]),o("div",X,[t(e,{modelValue:c.value,"onUpdate:modelValue":d[2]||(d[2]=m=>c.value=m)},{default:r(()=>[t(a,{label:"\u5907\u9009\u98791",border:""}),t(a,{label:"\u5907\u9009\u98792",border:"",disabled:""})]),_:1},8,["modelValue"])]),o("div",j,[t(e,{modelValue:s.value,"onUpdate:modelValue":d[3]||(d[3]=m=>s.value=m),disabled:""},{default:r(()=>[t(a,{label:"\u5907\u9009\u98791",border:""}),t(a,{label:"\u5907\u9009\u98792",border:""})]),_:1},8,["modelValue"])])],64)}}},z={class:"markdown-body"},J=o("h1",null,"Checkbox \u591A\u9009",-1),K=o("h4",null,"\u5E38\u7528\u4ECE\u4E00\u7EC4\u6570\u636E\u4E2D\u9009\u62E9\u591A\u4E2A\u6570\u636E",-1),M=o("br",null,null,-1),P=o("h2",null,"\u57FA\u7840\u7528\u6CD5",-1),Q=o("h4",null,"\u5355\u72EC\u4F7F\u7528\u53EF\u4EE5\u8868\u793A\u4E24\u79CD\u72B6\u6001\u4E4B\u95F4\u7684\u5207\u6362\uFF0C\u5199\u5728\u6807\u7B7E\u4E2D\u7684\u5185\u5BB9\u4E3A checkbox \u6309\u94AE\u540E\u7684\u4ECB\u7ECD",-1),R=o("p",null,"\u5355\u4E00\u7684checkbox\u4E2D\uFF0C\u9ED8\u8BA4\u7ED1\u5B9A\u53D8\u91CF\u7684\u503C\u4F1A\u662FBoolean\uFF0C\u9009\u4E2D\u4E3Atrue",-1),W={class:"source"},Y=o("h2",null,"\u7981\u7528\u72B6\u6001",-1),Z=o("p",null,"\u591A\u9009\u6846\u4E0D\u53EF\u7528\u72B6\u6001\uFF0C\u8BBE\u7F6Edisabled\u5C5E\u6027\u5373\u53EF",-1),tt={class:"source"},et=o("h2",null,"\u591A\u9009\u6846\u7EC4",-1),ot=o("h4",null,"\u9002\u7528\u4E8E\u591A\u4E2A\u52FE\u9009\u6846\u7ED1\u5B9A\u5230\u540C\u4E00\u4E2A\u6570\u7EC4\u7684\u60C5\u666F\uFF0C\u901A\u8FC7\u662F\u5426\u52FE\u9009\u6765\u8868\u793A\u8FD9\u4E00\u7EC4\u9009\u9879\u4E2D\u9009\u4E2D\u7684\u9879",-1),dt={class:"source"},lt=o("h2",null,"\u4E2D\u95F4\u72B6\u6001",-1),at=o("h4",null,"indeterminate \u5C5E\u6027\u7528\u4EE5\u8868\u793A checkbox \u7684\u4E0D\u786E\u5B9A\u72B6\u6001\uFF0C\u4E00\u822C\u7528\u4E8E\u5B9E\u73B0\u5168\u9009\u7684\u6548\u679C",-1),nt={class:"source"},st=o("h2",null,"\u6309\u94AE\u6837\u5F0F",-1),ct=o("h4",null,"\u6309\u94AE\u6837\u5F0F\u7684\u591A\u9009\u7EC4\u5408",-1),rt={class:"source"},ut=o("h2",null,"\u5E26\u6709\u8FB9\u6846",-1),ht=o("h4",null,"\u8BBE\u7F6Eborder\u5C5E\u6027\u53EF\u4EE5\u6E32\u67D3\u4E3A\u5E26\u6709\u8FB9\u6846\u7684\u591A\u9009\u6846",-1),mt={class:"source"},_t=U("<h2>Checkbox Attributes</h2><table><thead><tr><th>\u53C2\u6570</th><th>\u8BF4\u660E</th><th>\u7C7B\u578B</th><th>\u53EF\u9009\u503C</th><th>\u9ED8\u8BA4\u503C</th></tr></thead><tbody><tr><td>v-model</td><td>\u7ED1\u5B9A\u503C</td><td>boolean</td><td>\u2014</td><td>\u2014</td></tr><tr><td>label</td><td>\u9009\u4E2D\u72B6\u6001\u7684\u503C\uFF08\u53EA\u6709\u5728<code>checkbox-group</code>\u6216\u8005\u7ED1\u5B9A\u5BF9\u8C61\u7C7B\u578B\u4E3A<code>array</code>\u65F6\u6709\u6548\uFF09</td><td>string / number / boolean</td><td>\u2014</td><td>\u2014</td></tr><tr><td>disabled</td><td>\u662F\u5426\u7981\u7528</td><td>boolean</td><td>\u2014</td><td>false</td></tr><tr><td>border</td><td>\u662F\u5426\u663E\u793A\u8FB9\u6846</td><td>boolean</td><td>\u2014</td><td>false</td></tr><tr><td>name</td><td>\u539F\u751F name \u5C5E\u6027</td><td>string</td><td>\u2014</td><td>\u2014</td></tr><tr><td>checked</td><td>\u5F53\u524D\u662F\u5426\u52FE\u9009</td><td>boolean</td><td>\u2014</td><td>false</td></tr><tr><td>indeterminate</td><td>\u8BBE\u7F6E indeterminate \u72B6\u6001\uFF0C\u53EA\u8D1F\u8D23\u6837\u5F0F\u63A7\u5236</td><td>boolean</td><td>\u2014</td><td>false</td></tr></tbody></table><br><h2>Checkbox Events</h2><table><thead><tr><th>\u4E8B\u4EF6\u540D\u79F0</th><th>\u8BF4\u660E</th><th>\u56DE\u8C03\u53C2\u6570</th></tr></thead><tbody><tr><td>change</td><td>\u5F53\u7ED1\u5B9A\u503C\u53D8\u5316\u65F6\u89E6\u53D1\u7684\u4E8B\u4EF6</td><td>\u66F4\u65B0\u540E\u7684\u503C</td></tr></tbody></table><br><h2>Checkbox-group Attributes</h2><table><thead><tr><th>\u53C2\u6570</th><th>\u8BF4\u660E</th><th>\u7C7B\u578B</th><th>\u53EF\u9009\u503C</th><th>\u9ED8\u8BA4\u503C</th></tr></thead><tbody><tr><td>value / v-model</td><td>\u7ED1\u5B9A\u503C</td><td>array</td><td>\u2014</td><td>\u2014</td></tr><tr><td>disabled</td><td>\u662F\u5426\u7981\u7528</td><td>boolean</td><td>\u2014</td><td>false</td></tr></tbody></table><br><h2>Checkbox-group Events</h2><table><thead><tr><th>\u4E8B\u4EF6\u540D\u79F0</th><th>\u8BF4\u660E</th><th>\u56DE\u8C03\u53C2\u6570</th></tr></thead><tbody><tr><td>change</td><td>\u5F53\u7ED1\u5B9A\u503C\u53D8\u5316\u65F6\u89E6\u53D1\u7684\u4E8B\u4EF6</td><td>\u66F4\u65B0\u540E\u7684\u503C</td></tr></tbody></table><br><h2>Checkbox-button Attributes</h2><table><thead><tr><th>\u53C2\u6570</th><th>\u8BF4\u660E</th><th>\u7C7B\u578B</th><th>\u53EF\u9009\u503C</th><th>\u9ED8\u8BA4\u503C</th></tr></thead><tbody><tr><td>label</td><td>\u9009\u4E2D\u72B6\u6001\u7684\u503C\uFF08\u53EA\u6709\u5728<code>checkbox-group</code>\u6216\u8005\u7ED1\u5B9A\u5BF9\u8C61\u7C7B\u578B\u4E3A<code>array</code>\u65F6\u6709\u6548\uFF09</td><td>string / number / boolean</td><td>\u2014</td><td>\u2014</td></tr><tr><td>disabled</td><td>\u662F\u5426\u7981\u7528</td><td>boolean</td><td>\u2014</td><td>false</td></tr><tr><td>name</td><td>\u539F\u751F name \u5C5E\u6027</td><td>string</td><td>\u2014</td><td>\u2014</td></tr></tbody></table>",14),ft={__name:"doc",setup(V,{expose:l}){return l({frontmatter:{}}),(c,s)=>(_(),b("div",z,[J,K,M,P,Q,R,o("div",W,[t(B)]),t(f,{compName:"checkbox",demoName:"demo1"}),Y,Z,o("div",tt,[t(D)]),t(f,{compName:"checkbox",demoName:"demo2"}),et,ot,o("div",dt,[t(w)]),t(f,{compName:"checkbox",demoName:"demo3"}),lt,at,o("div",nt,[t(I)]),t(f,{compName:"checkbox",demoName:"demo4"}),st,ct,o("div",rt,[t(S)]),t(f,{compName:"checkbox",demoName:"demo5"}),ut,ht,o("div",mt,[t(q)]),t(f,{compName:"checkbox",demoName:"demo6"}),_t]))}};export{ft as default};