Giter VIP home page Giter VIP logo

Comments (8)

jin-yufeng avatar jin-yufeng commented on May 29, 2024

这是本地图片?

from mp-html.

wearwlnd avatar wearwlnd commented on May 29, 2024

这是本地图片?

这个是编辑器里面上传的图片 保存的路径是相对路径

from mp-html.

wearwlnd avatar wearwlnd commented on May 29, 2024

这是本地图片?

我在trees.wxml里面把data-src的路径补充完整,DomHandler.js里面的
if (attrs['data-src']) {
attrs.src = attrs.src || attrs['data-src'];
delete attrs['data-src'];
}
好像不起作用 不知道是什么原因

from mp-html.

jin-yufeng avatar jin-yufeng commented on May 29, 2024

那个是在没有src时把data-src赋给src,有src的时候就不起效果了;而且wxml里的data-src是用来点击预览用的;没有办法直接把src补充完整吗?

from mp-html.

jin-yufeng avatar jin-yufeng commented on May 29, 2024

在后端加强包里是可以通过设置domain来自动把src补全的,前端插件包暂时还没有这样的功能

from mp-html.

wearwlnd avatar wearwlnd commented on May 29, 2024

那个是在没有src时把data-src赋给src,有src的时候就不起效果了;而且wxml里的data-src是用来点击预览用的;没有办法直接把src补充完整吗?

这倒是个办法 我去看一下编辑器 有没有办法把编辑器保存的图片路径变成绝对路径

from mp-html.

jin-yufeng avatar jin-yufeng commented on May 29, 2024

不行的话我觉得暂时可以用正则替换上去😂(反正一定要有完整的地址才能显示)
html=html.replace(/src="\//g,'src="http://xxx.com/')

from mp-html.

wearwlnd avatar wearwlnd commented on May 29, 2024

不行的话我觉得暂时可以用正则替换上去😂(反正一定要有完整的地址才能显示)
html=html.replace(/src="\//g,'src="http://xxx.com/')

也对哦 我怎么没想到 太感谢啦🙏

from mp-html.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.