From afa23c21116dcfd7e6f4eac5b1f2be7ef242ee15 Mon Sep 17 00:00:00 2001
From: 若依 <yzz_ivy@163.com>
Date: Wed, 24 Aug 2022 15:31:31 +0800
Subject: [PATCH] !240 update ruoyi-ui/src/components/FileUpload/index.vue. Merge pull request !240 from exiace/N/A
---
ruoyi-ui/src/utils/generator/html.js | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/ruoyi-ui/src/utils/generator/html.js b/ruoyi-ui/src/utils/generator/html.js
index 8362ae4..d62fd5d 100644
--- a/ruoyi-ui/src/utils/generator/html.js
+++ b/ruoyi-ui/src/utils/generator/html.js
@@ -5,11 +5,11 @@
let someSpanIsNot24
export function dialogWrapper(str) {
- return `<el-dialog v-bind="$attrs" v-on="$listeners" @open="onOpen" @close="onClose" title="Dialog Titile">
+ return `<el-dialog v-bind="$attrs" v-on="$listeners" @open="onOpen" @close="onClose" title="Dialog Title">
${str}
<div slot="footer">
<el-button @click="close">取消</el-button>
- <el-button type="primary" @click="handelConfirm">确定</el-button>
+ <el-button type="primary" @click="handleConfirm">确定</el-button>
</div>
</el-dialog>`
}
@@ -107,6 +107,18 @@
}
const tags = {
+ 'el-button': el => {
+ const {
+ tag, disabled
+ } = attrBuilder(el)
+ const type = el.type ? `type="${el.type}"` : ''
+ const icon = el.icon ? `icon="${el.icon}"` : ''
+ const size = el.size ? `size="${el.size}"` : ''
+ let child = buildElButtonChild(el)
+
+ if (child) child = `\n${child}\n` // 换行
+ return `<${el.tag} ${type} ${icon} ${size} ${disabled}>${child}</${el.tag}>`
+ },
'el-input': el => {
const {
disabled, vModel, clearable, placeholder, width
@@ -272,6 +284,15 @@
}
}
+// el-buttin 子级
+function buildElButtonChild(conf) {
+ const children = []
+ if (conf.default) {
+ children.push(conf.default)
+ }
+ return children.join('\n')
+}
+
// el-input innerHTML
function buildElInputChild(conf) {
const children = []
--
Gitblit v1.9.3