Skip to content

Commit

Permalink
Site updated: 2023-08-18 15:22:36
Browse files Browse the repository at this point in the history
  • Loading branch information
张文龙 committed Aug 18, 2023
1 parent 53fa2e2 commit f7756ba
Show file tree
Hide file tree
Showing 19 changed files with 152 additions and 622 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ <h1 class="article-title" itemprop="name">
<div class="outer">
<div id="footer-info">
<div class="footer-left">
&copy; 2022 张文龙
&copy; 2023 张文龙
</div>
<div class="footer-right">
<a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
Expand Down Expand Up @@ -434,16 +434,12 @@ <h1 class="article-title" itemprop="name">
</label>
<ul class="article-tag-list" q-show="showTags">

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color3">前端</a>
</li>

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color3">随笔</a>
</li>

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color1">bug解决</a>
<a href="javascript:void(0)" class="js-tag color3">前端</a>
</li>

<div class="clearfix"></div>
Expand Down
8 changes: 2 additions & 6 deletions 2021/12/18/《误杀》观后感/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ <h5 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</
<div class="outer">
<div id="footer-info">
<div class="footer-left">
&copy; 2022 张文龙
&copy; 2023 张文龙
</div>
<div class="footer-right">
<a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
Expand Down Expand Up @@ -459,16 +459,12 @@ <h5 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</
</label>
<ul class="article-tag-list" q-show="showTags">

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color3">前端</a>
</li>

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color3">随笔</a>
</li>

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color1">bug解决</a>
<a href="javascript:void(0)" class="js-tag color3">前端</a>
</li>

<div class="clearfix"></div>
Expand Down
8 changes: 2 additions & 6 deletions 2022/01/14/uniapp系统检查更新/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ <h5 id="uniapp小程序更新、App整包更新以及资源在线升级-热更
<div class="outer">
<div id="footer-info">
<div class="footer-left">
&copy; 2022 张文龙
&copy; 2023 张文龙
</div>
<div class="footer-right">
<a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
Expand Down Expand Up @@ -427,16 +427,12 @@ <h5 id="uniapp小程序更新、App整包更新以及资源在线升级-热更
</label>
<ul class="article-tag-list" q-show="showTags">

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color3">前端</a>
</li>

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color3">随笔</a>
</li>

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color1">bug解决</a>
<a href="javascript:void(0)" class="js-tag color3">前端</a>
</li>

<div class="clearfix"></div>
Expand Down
8 changes: 2 additions & 6 deletions 2022/01/19/hexo搭建博客相关操作/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ <h1 class="article-title" itemprop="name">
<div class="outer">
<div id="footer-info">
<div class="footer-left">
&copy; 2022 张文龙
&copy; 2023 张文龙
</div>
<div class="footer-right">
<a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
Expand Down Expand Up @@ -447,16 +447,12 @@ <h1 class="article-title" itemprop="name">
</label>
<ul class="article-tag-list" q-show="showTags">

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color3">前端</a>
</li>

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color3">随笔</a>
</li>

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color1">bug解决</a>
<a href="javascript:void(0)" class="js-tag color3">前端</a>
</li>

<div class="clearfix"></div>
Expand Down
12 changes: 4 additions & 8 deletions 2022/01/21/钉钉授权登录/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,11 @@ <h5 id="钉钉授权登录相关操作"><a href="#钉钉授权登录相关操作

<nav id="article-nav">

<a href="/2022/01/28/%E7%8E%A9%E8%BD%AC%E7%BB%84%E4%BB%B6/" id="article-nav-newer" class="article-nav-link-wrap">
<a href="/2022/03/02/%E5%BE%AE%E4%BF%A1%E7%BD%91%E9%A1%B5%E6%8E%88%E6%9D%83%E7%99%BB%E5%BD%95/" id="article-nav-newer" class="article-nav-link-wrap">
<i class="icon-circle-left"></i>
<div class="article-nav-title">

玩转组件
微信网页授权登录

</div>
</a>
Expand Down Expand Up @@ -360,7 +360,7 @@ <h5 id="钉钉授权登录相关操作"><a href="#钉钉授权登录相关操作
<div class="outer">
<div id="footer-info">
<div class="footer-left">
&copy; 2022 张文龙
&copy; 2023 张文龙
</div>
<div class="footer-right">
<a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
Expand Down Expand Up @@ -434,16 +434,12 @@ <h5 id="钉钉授权登录相关操作"><a href="#钉钉授权登录相关操作
</label>
<ul class="article-tag-list" q-show="showTags">

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color3">前端</a>
</li>

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color3">随笔</a>
</li>

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color1">bug解决</a>
<a href="javascript:void(0)" class="js-tag color3">前端</a>
</li>

<div class="clearfix"></div>
Expand Down
16 changes: 6 additions & 10 deletions 2022/03/02/微信网页授权登录/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,18 @@ <h4 id="微信网页授权登录-OAuth-2-0"><a href="#微信网页授权登录-O

<nav id="article-nav">

<a href="/2022/03/14/uniapp%E8%BF%90%E8%A1%8C%E5%88%B0%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F-%E5%90%AF%E5%8A%A8%E6%8A%A5-TypeError-Cannot-read-property-MutationObserver-of-undefined/" id="article-nav-newer" class="article-nav-link-wrap">
<a href="/2023/08/18/%E8%87%AA%E5%AE%9A%E4%B9%89%E7%BA%BF%E6%80%A7%E5%8F%98%E5%8C%96%E5%87%BD%E6%95%B0/" id="article-nav-newer" class="article-nav-link-wrap">
<i class="icon-circle-left"></i>
<div class="article-nav-title">

uniapp运行到微信小程序 启动报 TypeError: Cannot read property &#39;MutationObserver&#39; of undefined
自定义线性变化函数

</div>
</a>


<a href="/2022/01/28/%E7%8E%A9%E8%BD%AC%E7%BB%84%E4%BB%B6/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">玩转组件</div>
<a href="/2022/01/21/%E9%92%89%E9%92%89%E6%8E%88%E6%9D%83%E7%99%BB%E5%BD%95/" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">钉钉授权登录</div>
<i class="icon-circle-right"></i>
</a>

Expand Down Expand Up @@ -356,7 +356,7 @@ <h4 id="微信网页授权登录-OAuth-2-0"><a href="#微信网页授权登录-O
<div class="outer">
<div id="footer-info">
<div class="footer-left">
&copy; 2022 张文龙
&copy; 2023 张文龙
</div>
<div class="footer-right">
<a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
Expand Down Expand Up @@ -430,16 +430,12 @@ <h4 id="微信网页授权登录-OAuth-2-0"><a href="#微信网页授权登录-O
</label>
<ul class="article-tag-list" q-show="showTags">

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color3">前端</a>
</li>

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color3">随笔</a>
</li>

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color1">bug解决</a>
<a href="javascript:void(0)" class="js-tag color3">前端</a>
</li>

<div class="clearfix"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
<link rel="dns-prefetch" href="http://example.com">
<title>uniapp运行到微信小程序 启动报 TypeError: Cannot read property &#39;MutationObserver&#39; of undefined | 张文龙的个人博客 - Zhang WenLong&#39;s Personal Blog</title>
<title>自定义线性变化函数 | 张文龙的个人博客 - Zhang WenLong&#39;s Personal Blog</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="微信小程序中自带vconsole">
<meta name="description" content="自定义线性变化函数">
<meta property="og:type" content="article">
<meta property="og:title" content="uniapp运行到微信小程序 启动报 TypeError: Cannot read property &#39;MutationObserver&#39; of undefined">
<meta property="og:url" content="http://example.com/2022/03/14/uniapp%E8%BF%90%E8%A1%8C%E5%88%B0%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F-%E5%90%AF%E5%8A%A8%E6%8A%A5-TypeError-Cannot-read-property-MutationObserver-of-undefined/index.html">
<meta property="og:title" content="自定义线性变化函数">
<meta property="og:url" content="http://example.com/2023/08/18/%E8%87%AA%E5%AE%9A%E4%B9%89%E7%BA%BF%E6%80%A7%E5%8F%98%E5%8C%96%E5%87%BD%E6%95%B0/index.html">
<meta property="og:site_name" content="张文龙的个人博客 - Zhang WenLong&#39;s Personal Blog">
<meta property="og:description" content="微信小程序中自带vconsole">
<meta property="og:description" content="自定义线性变化函数">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2022-03-14T06:24:02.000Z">
<meta property="article:modified_time" content="2022-03-14T06:43:34.728Z">
<meta property="article:published_time" content="2023-08-18T07:03:53.000Z">
<meta property="article:modified_time" content="2023-08-18T07:22:01.966Z">
<meta property="article:author" content="张文龙">
<meta property="article:tag" content="bug解决">
<meta property="article:tag" content="前端">
<meta name="twitter:card" content="summary">

<link rel="alternative" href="/atom.xml" title="张文龙的个人博客 - Zhang WenLong&#39;s Personal Blog" type="application/atom+xml">
Expand Down Expand Up @@ -159,36 +159,37 @@ <h1 class="header-author js-header-author">张文龙</h1>
<canvas data-colors="#eaeaea" data-sectionHeight="100" data-contentId="js-content" id="myCanvas1" class="anm-canvas"></canvas>
</div>
<div id="js-content" class="content-ll">
<article id="post-uniapp运行到微信小程序-启动报-TypeError-Cannot-read-property-MutationObserver-of-undefined" class="article article-type-post " itemscope itemprop="blogPost">
<article id="post-自定义线性变化函数" class="article article-type-post " itemscope itemprop="blogPost">
<div class="article-inner">

<header class="article-header">


<h1 class="article-title" itemprop="name">
uniapp运行到微信小程序 启动报 TypeError: Cannot read property &#39;MutationObserver&#39; of undefined
自定义线性变化函数
</h1>



<a href="/2022/03/14/uniapp%E8%BF%90%E8%A1%8C%E5%88%B0%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F-%E5%90%AF%E5%8A%A8%E6%8A%A5-TypeError-Cannot-read-property-MutationObserver-of-undefined/" class="archive-article-date">
<time datetime="2022-03-14T06:24:02.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2022-03-14</time>
<a href="/2023/08/18/%E8%87%AA%E5%AE%9A%E4%B9%89%E7%BA%BF%E6%80%A7%E5%8F%98%E5%8C%96%E5%87%BD%E6%95%B0/" class="archive-article-date">
<time datetime="2023-08-18T07:03:53.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2023-08-18</time>
</a>

</header>

<div class="article-entry" itemprop="articleBody">

<p><strong>微信小程序中自带vconsole</strong></p>
<span id="more"></span>
<h5 id="自定义线性变化函数"><a href="#自定义线性变化函数" class="headerlink" title="自定义线性变化函数"></a>自定义线性变化函数</h5><span id="more"></span>

<p>错误源</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">// main.js 引入vconsole引起</span><br><span class="line">import Vconsole from &#x27;vconsole&#x27;;</span><br><span class="line">new Vconsole();</span><br></pre></td></tr></table></figure>
<p>函数</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">const</span> scale = <span class="function">(<span class="params">num, in_min, in_max, out_min, out_max</span>) =&gt;</span> &#123;</span><br><span class="line"> <span class="keyword">return</span> ((num - in_min) * (out_max - out_min)) / (in_max - in_min) + out_min</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>修正:</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">// main.js 引入vconsole引起</span><br><span class="line">// #ifdef H5</span><br><span class="line">import Vconsole from &#x27;vconsole&#x27;;</span><br><span class="line">new Vconsole();</span><br><span class="line">// #endif</span><br></pre></td></tr></table></figure>

<p>总结:微信小程序中自带vconsole,所以在引入的时候需要加上编译条件,排除掉微信。</p>
<p>作用:随着number在inMin和inMax区间里的变化,线性输出outMin到outMax的值。</p>
<p>假设个场景:</p>
<p>​ 现在有一张较大的图片,需要显示这张图片的加载百分比,一开始显示0%,随着图片加载逐渐增大, 等图片完全加载完成后就不再显示百分比。 </p>
<p>实现思路:有一个标签用来显示百分比数字。随着图片加载的大小去动态改变标签的opacity样式,从1到0。</p>
<p>​ 使用scale函数,num为图片加载的大小,从0到100,输出值为从1到0。</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">element.style.opacity = scale(load, <span class="number">0</span>, <span class="number">100</span>, <span class="number">1</span>, <span class="number">0</span>)</span><br></pre></td></tr></table></figure>



Expand All @@ -202,7 +203,7 @@ <h1 class="article-title" itemprop="name">
<ul class="article-tag-list">

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color1">bug解决</a>
<a href="javascript:void(0)" class="js-tag article-tag-list-link color3">前端</a>
</li>

</ul>
Expand Down Expand Up @@ -258,7 +259,7 @@ <h1 class="article-title" itemprop="name">
<a class="close js-modal-close" href="javascript:;"><i class="icon icon-close"></i></a>
<p>扫一扫,分享到微信</p>
<div class="wx-qrcode">
<img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=http://zwlHub.github.io/022/03/14/uniapp%E8%BF%90%E8%A1%8C%E5%88%B0%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F-%E5%90%AF%E5%8A%A8%E6%8A%A5-TypeError-Cannot-read-property-MutationObserver-of-undefined/" alt="微信分享二维码">
<img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=http://zwlHub.github.io/023/08/18/%E8%87%AA%E5%AE%9A%E4%B9%89%E7%BA%BF%E6%80%A7%E5%8F%98%E5%8C%96%E5%87%BD%E6%95%B0/" alt="微信分享二维码">
</div>
</div>

Expand Down Expand Up @@ -301,7 +302,7 @@ <h1 class="article-title" itemprop="name">
</span>
<span class="tooltip-content">
<div class="toc-article">
目录,不存在的…
<ol class="toc"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E8%87%AA%E5%AE%9A%E4%B9%89%E7%BA%BF%E6%80%A7%E5%8F%98%E5%8C%96%E5%87%BD%E6%95%B0"><span class="toc-number">1.</span> <span class="toc-text">自定义线性变化函数</span></a></li></ol>
</div>
</span>
</div>
Expand All @@ -317,7 +318,7 @@ <h1 class="article-title" itemprop="name">



<div id="SOHUCS" sid="uniapp运行到微信小程序-启动报-TypeError-Cannot-read-property-MutationObserver-of-undefined" ></div>
<div id="SOHUCS" sid="自定义线性变化函数" ></div>
<script charset="utf-8" type="text/javascript" src="//changyan.sohu.com/upload/changyan.js" ></script>
<script type="text/javascript">
window.changyan.api.config({
Expand Down Expand Up @@ -345,7 +346,7 @@ <h1 class="article-title" itemprop="name">
<div class="outer">
<div id="footer-info">
<div class="footer-left">
&copy; 2022 张文龙
&copy; 2023 张文龙
</div>
<div class="footer-right">
<a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
Expand Down Expand Up @@ -419,16 +420,12 @@ <h1 class="article-title" itemprop="name">
</label>
<ul class="article-tag-list" q-show="showTags">

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color3">前端</a>
</li>

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color3">随笔</a>
</li>

<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag color1">bug解决</a>
<a href="javascript:void(0)" class="js-tag color3">前端</a>
</li>

<div class="clearfix"></div>
Expand Down
Loading

0 comments on commit f7756ba

Please sign in to comment.