js代码如下:
const h = this.$createElement;
h("p", null, [
h("span", null, "是否删除配置 "),
h("i", { style: "color: #E6A23C" }, `${names}.join(",")`)
]),
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
)
names是代表姓名的一个数组,我现在想将其循环渲染,请问用render如何实现?
其中
MyComponent
可以是vue组件,你把循环渲染的需求放到组件中就行了。不过, 用jsx更简洁,先得需要
babel-plugin-transform-vue-jsx
插件,就可以舒服些了