28s计时器加载转圈图片+setTimeout

<view class="jishiqi" v-if="!Newtata">
                <image src="../../../static/center/hehehe.gif"></image>
            </view>
hehehe.gif

设置的倒计时

想让他离开当前页面停止计时,结束此任务

setTimeoutDiy: setTimeout(() => {
                    this.Newtata = true;
                    this.NewTask()
                }, 28000), //28S



生命周期中

if (this.setTimeoutDiy) {
                clearTimeout(this.setTimeoutDiy);
                this.setTimeoutDiy = null;
            }

接口拿到的文档,,放到视图view中

若是使用直接封装好的方法

<!-- content -->
            <view class="sh-sh-rich text-indent">

                <view v-html="content"></view>
                <!-- <rich-text :nodes="content"></rich-text> -->
            </view>


<!--
             浏览器视屏
            -可以播放视屏
               只是没有办法显示计时器  
              直接跳转的链接进入新闻页 
             <view class="">
                <web-view :src="url"></web-view>
            </view> -->```


const regex = new RegExp('<img', 'gi');
that.content = item.content.replace(regex, <img style="width: 100%;height:400upx border-radius: 8Px;margin-left: -12%;");
// 控制内容图片 防止脱离文档流
// that.content = item.content
// .replace(/<img([\s\w"-=/.:;]+)((?:(height="[^"]+")))/ig, '<img1') // .replace(/<img([\s\w"-=\/\.:;]+)((?:(width="[^"]+")))/ig, '<img1')
// .replace(/<img([\s\w"-=/.:;]+)((?:(style="[^"]+")))/ig, '<img1') // .replace(/<img([\s\w"-=\/\.:;]+)((?:(alt="[^"]+")))/ig, '<img1')
// .replace(/<img([\s\w"-=/.:;]+)/ig,
// '<img$1 style="width: 100%;height:400upx border-radius: 8Px;margin-left: -12%;"');

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容