text: "use strict";(self.webpackChunkz_paging_doc=self.webpackChunkz_paging_doc||[]).push([[301],{1606:(n,s,a)=>{a.r(s),a.d(s,{data:()=>e});const e={key:"v-d4a7df0c",path:"/api/props/global-config.html",title:"",lang:"zh-CN",frontmatter:{},excerpt:"",headers:[{level:2,title:"支持全局配置",slug:"支持全局配置",children:[{level:3,title:"",slug:"",children:[]}]}],filePathRelative:"api/props/global-config.md",git:{updatedTime:1629561936e3}}},6437:(n,s,a)=>{a.r(s),a.d(s,{default:()=>l});var e=a(6252);const p=(0,e.uE)('<h2 id="支持全局配置" tabindex="-1"><a class="header-anchor" href="#支持全局配置" aria-hidden="true">#</a> 支持全局配置</h2><div class="custom-container tip"><p class="custom-container-title">说明</p><p>支持统一配置z-paging的所有属性，非必须！！！</p></div><div class="custom-container danger"><p class="custom-container-title">注意</p><p>这里的全局配置不是全局引入组件，全局配置是指统一配置z-paging默认的属性值，z-paging遵循easycom组件规范，无需注册即可使用。</p></div><p style="color:red;font-weight:bold;"></p>',4),t={href:"https://uniapp.dcloud.io/component/README?id=easycom%E7%BB%84%E4%BB%B6%E8%A7%84%E8%8C%83",target:"_blank",rel:"noopener noreferrer"},o=(0,e.Uk)("点击查看easycom组件规范"),c=(0,e.uE)('<ul><li>(推荐)【方案1】在路径<code>@/uni_modules/z-paging</code>下创建<code>z-paging-config.js</code>(与z-paging目录下的readme.md同级)，<code>z-paging-config.js</code>中的内容如下所示。</li></ul><div class="language-json ext-json line-numbers-mode"><pre class="language-json"><code>module.exports = <span class="token punctuation">{</span>\n\t<span class="token comment">//配置分页默认pageSize为15</span>\n\t&#39;default-page-size&#39;<span class="token operator">:</span> &#39;<span class="token number">15</span>&#39;<span class="token punctuation">,</span>\n\t<span class="token comment">//配置空数据图默认描述文字为：空空如也~~</span>\n\t&#39;empty-view-text&#39;<span class="token operator">:</span> &#39;空空如也~~&#39;<span class="token punctuation">,</span>\n\t<span class="token comment">//...</span>\n<span class="token punctuation">}</span>\n</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><ul><li>【方案二】在<code>main.js</code>中<code>import zConfig from &#39;@/uni_modules/z-paging/components/z-paging/js/z-paging-config&#39;</code>(此路径为使用uni_modules情况下使用，可依照具体情况进行修改)，然后进行<code>z-paging</code>的全局配置：</li></ul><div class="custom-container danger"><p class="custom-container-title">注意</p><p>如果调用过setConfig进行配置，后期又需要取消配置，则必须设置zConfig.setConfig(null)将配置置空，因为setConfig是将配置设置在缓存中，直接删除配置代码将导致原先缓存的配置无法清空。</p></div><div class="language-javascript ext-js line-numbers-mode"><pre class="language-javascript"><code>zConfig<span class="token punctuation">.</span><span class="token function">setConfig</span><span class="token punctuation">(</span><span class="token punctuation">{</span>\n\t<span class="token comment">//配置分页默认pageSize为15</span>\n\t<span class="token string">&#39;default-page-size&#39;</span><span class="token operator">:</span> <span class="token string">&#39;15&#39;</span><span class="token punctuation">,</span>\n\t<span class="token comment">//配置空数据图默认描述文字为：空空如也~~</span>\n\t<span class="token string">&#39;empty-view-text&#39;</span><span class="token operator">:</span> <span class="token string">&#39;空空如也~~&#39;</span><span class="token punctuation">,</span>\n\t<span class="token comment">//...</span>\n<span class="token punctuation">}</span><span class="token punctuation">)</span>\n</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><hr><h3 id="" tabindex="-1"><a class="header-anchor" href="#" aria-hidden="true">#</a></h3>',7),l={render:function(n,s){const a=(0,e.up)("OutboundLink");return(0,e.wg)(),(0,e.iD)(e.HY,null,[p,(0,e._)("p",null,[(0,e._)("a",t,[o,(0,e.Wm)(a)])]),c],64)}}}}]);