为什么innerHTML不解析成HTML

为什么innerHTML不解析成HTML

调用数据库内容,解析HTML

相关代码1

// 请把代码文本粘贴到下方(请勿用图片代替代码)
function(t, e, i) {
    "use strict";
    Object.defineProperty(e, "__esModule", {
        value: !0
    });
    var n = i(971);
    new Vue({
        render: function(t) {
            return t(n.a)
        }
    }).$mount("#app")
},
function(t, e, i) {
    "use strict";
    function n(t) {
        i(972)
    }
    var s = (i(973), i(974)),
    a = i(975),
    r = i(0),
    o = n,
    l = r(s.a, a.a, !1, o, "data-v-25e7085a", null);
    e.a = l.exports
},
function(t, e) {},
function(t, e, i) {
    "use strict";
    var n = i(3),
    s = i(4),
    a = i(7),
    r = i(9),
    o = i(29),
    l = i(25),
    c = i(30);
    a.a,
    r.a,
    o.a,
    l.a,
    c.f
},
function(t, e, i) {
    "use strict";
    var n = i(3),
    s = i(4),
    a = i(7),
    r = i(9),
    o = i(29),
    l = i(25),
    c = i(30);
    e.a = {
        components: {
            ViewBox: a.a,
            XHeader: r.a,
            Tabbar: o.a,
            TabbarItem: l.a,
            LnPreviewer: c.f
        },
        data: function() {
            return {
                item: [],
                legth: 0,
                sharedata: {},
                px: 0,
                tagheight: "240px",
                images: []
            }
        },
        beforeCreate: function() {},
        beforeMount: function() {
            var t = this,
            e = this;
            e.$vux.loading.show();
            var i = n.a.M.urlQuery("id");
            s.a.houseleaseDetail(i).then(function(i) {
                t.item = i.data,
                t.images = t.normalImg(i.data.images),
                e.px = e.item.hstatus ? "46px": "0";
                var n = "";
                0 != i.data.images.length && (n = e.item.images[0].src),
                e.sharedata = {
                    title: e.item.region + e.item.content + e.item.way + e.item.fitment,
                    imgUrl: n,
                    desc: e.item.content
                },
                wx.ready(function() {
                    wx.onMenuShareAppMessage(e.sharedata),
                    wx.onMenuShareTimeline(e.sharedata),
                    wx.onMenuShareQQ(e.sharedata),
                    wx.onMenuShareWeibo(e.sharedata)
                })
            }).
            catch(function(t) {
                e.$vux.toast.show({
                    type: "warn",
                    text: t.err_msg
                })
            })
        },
        mounted: function() {
            var t = this;
            setTimeout(function() {
                t.$vux.loading.hide()
            },
            300);
            var e = window.innerWidth;
            e = .75 * (e > 600 ? 600 : e);
            var i = e + "px";
            this.tagheight = i
        },
        methods: {
            normalImg: function(t) {
                var e = [];
                return t.forEach(function(t, i) {
                    e.push({
                        src: t,
                        msrc: t
                    })
                }),
                e
            },
            gourl: function(t) {
                window.location.href = "tel:" + t
            },
            show: function(t) {
                console.log(t),
                this.$refs.previewer.show(t)
            },
            options: function() {
                var t = this;
                return {
                    getThumbBoundsFn: function(e) {
                        var i = t.$el.querySelectorAll(".previewer-demo-img")[e],
                        n = window.pageYOffset || document.documentElement.scrollTop,
                        s = i.getBoundingClientRect();
                        return {
                            x: s.left,
                            y: s.top + n,
                            w: s.width
                        }
                    }
                }
            },
            url: function() {
                return n.a.M.url("home")
            }
        },
        computed: {}
    }
},
function(t, e, i) {
    "use strict";
    var n = function() {
        var t = this,
        e = t.$createElement,
        i = t._self._c || e;
        return i("div", {
            staticStyle: {
                height: "100%",
                background: "#f5f5f5"
            }
        },
        [i("view-box", {
            ref: "viewBox",
            staticClass: "container",
            attrs: {
                "body-padding-top": t.px,
                "body-padding-bottom": "50px"
            }
        },
        [t.item.hstatus ? i("x-header", {
            staticStyle: {
                position: "absolute",
                width: "100%",
                left: "0",
                top: "0",
                "z-index": "100"
            },
            attrs: {
                slot: "header",
                title: "房屋租赁详情"
            },
            slot: "header"
        },
        [i("a", {
            staticStyle: {
                color: "#FFFFFF"
            },
            attrs: {
                slot: "right",
                href: t.url()
            },
            slot: "right"
        },
        [t._v("首页")])]) : t._e(), t._v(" "), t.images && 0 != t.images.length ? i("ln-previewer", {
            attrs: {
                list: t.images,
                type: 2,
                tagheight: t.tagheight
            }
        }) : t._e(), t._v(" "), i("div", {
            staticClass: "weui-flex lease-detail-price"
        },
        [i("div", {
            staticClass: "weui-flex__item"
        },
        [i("div", {
            staticClass: "lease-tit"
        },
        [i("span", [t._v(t._s(t.item.price) + "\n                    "), 1 == t.item.category || 2 == t.item.category ? i("samp", [t._v("元/月")]) : t._e(), t._v(" "), 3 == t.item.category || 4 == t.item.category ? i("samp", [t._v("元/月")]) : t._e()])]), t._v(" "), i("p", {
            staticClass: "lease-jianjie"
        },
        [t._v(t._s(t.item.house_model) + " | " + t._s(t.item.model_area) + "m² | " + t._s(t.item.fitment))])])]), t._v(" "), i("div", {
            staticClass: "weui-form-preview lease-detail-preview"
        },
        [i("div", {
            staticClass: "weui-form-preview__hd"
        },
        [i("div", {
            staticClass: "weui-form-preview__item"
        },
        [i("label", {},
        [t._v("房屋信息")])])]), t._v(" "), i("div", {
            staticClass: "weui-form-preview__bd"
        },
        [i("ul", {
            staticClass: "lease-detail-info"
        },
        [i("li", [t._v("类型:" + t._s(t.item.way))]), t._v(" "), i("li", [t._v("朝向:" + t._s(t.item.house_aspect))]), t._v(" "), i("li", [t._v("楼层:" + t._s(t.item.house_floor))]), t._v(" "), i("li", [3 == t.item.category || 4 == t.item.category ? i("span", [t._v("建筑年代:")]) : i("span", [t._v("可入驻:")]), t._v("\n                        " + t._s(t.item.checktime) + "\n                    ")]), t._v(" "), 1 == t.item.status ? i("li", [t._v("是否有房:满员")]) : t._e(), t._v(" "), 0 == t.item.status ? i("li", [t._v("是否有房:有房")]) : t._e(), t._v(" "), i("li", [t._v("发布时间:" + t._s(t.item.createtime))])])])]), t._v(" "), i("div", {
            staticClass: "weui-form-preview lease-detail-preview"
        },
        [i("div", {
            staticClass: "weui-form-preview__hd"
        },
        [i("div", {
            staticClass: "weui-form-preview__item"
        },
        [i("label", {},
        [t._v("配置设施")])])]), t._v(" "), i("div", {
            staticClass: "weui-form-preview__bd"
        },
        [i("ul", {
            staticClass: "lease-detail-allocation  "
        },
        [i("ul", t._l(t.item.list,
        function(e, n) {
            return i("li", [i("i", {
                class: e.icon
            }), t._v(t._s(e.title))])
        }))])])]), t._v(" "), i("div", {
            staticClass: "weui-form-preview lease-detail-preview"
        },
        [i("div", {
            staticClass: "weui-form-preview__hd"
        },
        [i("div", {
            staticClass: "weui-form-preview__item"
        },
        [i("label", {},
        [t._v("房源描述")])])]), t._v(" "), i("div", {
            staticClass: "weui-form-preview__bd"
        },
        [t._v(" "),i("ul", {
            staticClass: "lease-detail-allocation",
            domProps: {
                innerHTML: t._s(t.item.content)
            }
        })])]), t._v(" "), i("tabbar", {
            staticClass: "default_bottom",
            staticStyle: {
                "background-color": "#F7624B"
            },
            attrs: {
                slot: "bottom"
            },
            slot: "bottom"
        },
        [i("tabbar-item", {
            nativeOn: {
                click: function(e) {
                    t.gourl(t.item.tmobile)
                }
            }
        },
        [i("span", {
            staticStyle: {
                "font-size": "18px",
                color: "#FFFFFF"
            },
            attrs: {
                slot: "label"
            },
            slot: "label"
        },
        [t._v("电话咨询")])])], 1)], 1)], 1)
    },
    
    s = [],
    a = {
        render: n,
        staticRenderFns: s
    };
    e.a = a
}], [970]);

相关代码2

// 请把代码文本粘贴到下方(请勿用图片代替代码)

[t._v(" "),i("ul", {
            staticClass: "lease-detail-allocation",
            domProps: {
                innerHTML: t._s(t.item.content)
            }
        })]

请大神帮看一下?

阅读 1.2k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题