webpackJsonp([25],{OkI4:function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"wrapper"},[n("demo",{attrs:{title:"富文本",vertical:!0}},[n("div",{attrs:{slot:"demo"},slot:"demo"},[n("c-form",{ref:"form",attrs:{cells:t.cells,"init-data":t.initialData}},[n("p",{staticClass:"control",attrs:{slot:"footer"},slot:"footer"},[n("button",{staticClass:"button is-primary",class:{"is-disabled":t.isSubmitBtnDisabled},on:{click:function(e){e.preventDefault(),t.submit(e)}}},[t._v("提交")])])]),t._v(" "),n("p",[t._v(t._s(t.formRst))])],1),t._v(" "),n("div",{attrs:{slot:"desc"},slot:"desc"},[n("p",[t._v("富文本，基于wangedit v2.0版本，等wangedit3.0功能完善切换到3.0。")])]),t._v(" "),n("d-code",{attrs:{slot:"code",lang:"auto"},slot:"code"},[t._v(t._s(t.code))])],1)],1)},s=[],i={render:a,staticRenderFns:s};e.a=i},"Q+Hz":function(t,e,n){"use strict";function a(t){n("QrEK")}Object.defineProperty(e,"__esModule",{value:!0});var s=n("jvXH"),i=n.n(s);for(var r in s)"default"!==r&&function(t){n.d(e,t,function(){return s[t]})}(r);var l=n("OkI4"),o=n("VU/8"),u=a,c=o(i.a,l.a,!1,u,null,null);e.default=c.exports},QrEK:function(t,e,n){var a=n("yJUh");"string"==typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);n("rjj0")("5b7e7c9d",a,!0,{})},i2eX:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default="\n<template>\n   <c-form :cells=\"cells\" ref=\"form\" :init-data=\"initialData\">\n      <p class=\"control\" slot=\"footer\">\n        <button class=\"button is-primary\" :class=\"{ 'is-disabled': isSubmitBtnDisabled }\" @click.prevent=\"submit\">提交</button>\n      </p>\n   </c-form>\n   <p>{{formRst}}</p>\n</template>\n\n<script>\n  import message from 'components/message'\n\n  export default {\n    data () {\n      return {\n        isSubmitBtnDisabled: false,\n        initialData: {},\n        formRst: ''\n      }\n    },\n    computed: {\n      cells () {\n        return {\n          richtext1: {\n            label: '富文本1',\n            type: 'richtext',\n            attrs: {\n              placeholder: ''\n            },\n            validate: {\n              required: {\n                message: '请编辑文本'\n              },\n              maxlength: {\n                rule: 65536,\n                message: '文本不长于65536个字符'\n              }\n            }\n          },\n          richtext2: {\n            label: '富文本2',\n            type: 'richtext',\n            attrs: {\n              placeholder: ''\n            },\n            validate: {\n            }\n          },\n        }\n      }\n    },\n    methods: {\n      submit () {\n        this.isSubmitBtnDisabled = true\n        let step = 'validate'\n        this.$refs.form.validateAll().then(() => {\n          step = 'getData'\n          return this.$refs.form.defaultMutate()\n        }).then(data => {\n          this.formRst = JSON.stringify(data)\n        }).catch(error => {\n          if (step === 'validate') {\n            message.info('校验不通过')\n          } else if (step === 'getData') {\n            message.info(error.message)\n          }\n        }).finally(() => {\n          this.isSubmitBtnDisabled = false\n        })\n        return false\n      }\n    }\n  }\n<\/script>\n",t.exports=e.default},jvXH:function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var s=n("i2eX"),i=a(s),r=n("WB2H"),l=a(r);e.default={data:function(){return{code:i.default,isSubmitBtnDisabled:!1,initialData:{},formRst:""}},computed:{cells:function(){return{richtext1:{label:"富文本1",type:"richtext",attrs:{placeholder:""},validate:{required:{message:"请编辑文本"},maxlength:{rule:65536,message:"文本不长于65536个字符"}}},richtext2:{label:"富文本2",type:"richtext",attrs:{placeholder:""},validate:{}}}}},methods:{submit:function(){var t=this;this.isSubmitBtnDisabled=!0;var e="validate";return this.$refs.form.validateAll().then(function(){return e="getData",t.$refs.form.defaultMutate()}).then(function(e){t.formRst=JSON.stringify(e)}).catch(function(t){"validate"===e?l.default.info("校验不通过"):"getData"===e&&l.default.info(t.message)}).finally(function(){t.isSubmitBtnDisabled=!1}),!1}}},t.exports=e.default},yJUh:function(t,e,n){e=t.exports=n("FZ+f")(),e.push([t.i,"",""])}});