mk33mk333 / vue-template-transform

将渲染函数转换回vue模板
17 stars 12 forks source link

一种会出错的格式 #1

Open xuehuli8210 opened 3 years ago

xuehuli8210 commented 3 years ago
{
            render: function() {
                var e = this
                  , t = e.$createElement
                  , i = e._self._c || t;
                return i("div", {
                    directives: [{
                        name: "show",
                        rawName: "v-show",
                        value: "video" == e.element.video,
                        expression: "element.video=='video'"
                    }],
                    staticClass: "video-button"
                }, [i("ul", e._l(e.videoButton, function(t) {
                    return i("li", {
                        class: {
                            selected: e.element.properties.src == t
                        }
                    }, [i("img", {
                        attrs: {
                            src: t,
                            width: "500",
                            height: "500",
                            alt: ""
                        },
                        on: {
                            click: function(n) {
                                return e.editVideo({
                                    src: t
                                })
                            }
                        }
                    })])
                }), 0)])
            },
            staticRenderFns: [function() {
                var e = this.$createElement
                  , t = this._self._c || e;
                return t("div", [t("div", {
                    staticClass: "wrapper"
                }, [t("i", {
                    staticClass: "e-icon editor"
                })])])
            }
            , function() {
                var e = this.$createElement
                  , t = this._self._c || e;
                return t("p", {
                    staticClass: "base-tit"
                }, [this._v("\n    dizhi         "), this._v(" "), t("i", {
                    staticClass: "iconfont icon-bangzhu1 cup",
                    staticStyle: {
                        "vertical-align": "-1px"
                    },
                    attrs: {
                        onclick: "window.open('')",
                        title: "查看"
                    }
                })])
            }
            ]
        }

这种写法会出错 需要 [i("ul", e._l(e.videoButton, function(t) { 改成 [i("ul", {} ,e._l(e.videoButton, function(t) {

xuehuli8210 commented 3 years ago

`` http://hcysun.me/vue-template-compiler-playground/ 用他测试vue 的确会生成种种格式

xuehuli8210 commented 3 years ago

有没有 Githubissues.

  • Githubissues is a development platform for aggregating issues.