diff --git a/src/components/TagInput/index.vue b/src/components/TagInput/index.vue index 0863728b..8e99d037 100644 --- a/src/components/TagInput/index.vue +++ b/src/components/TagInput/index.vue @@ -14,7 +14,6 @@ import CodeMirror from "codemirror"; import "codemirror/lib/codemirror.css"; import { getRePosFromStr, MODE } from "./util"; -// import { isFunction } from "lodash-es"; const props = defineProps({ mode: { @@ -288,14 +287,14 @@ const renderColumnTag = (id: any, options: any, cb: any) => { const node = document.createElement("div"); node.classList.add("columnTagCon"); //自定义渲染tag - // if (props.renderTag && isFunction(props.renderTag)) { - // const tag = props.renderTag(id, options); - // if (tag instanceof HTMLElement) { - // node.appendChild(tag); - // cb(node); - // return; - // } - // } + if (props.renderTag) { + const tag = props.renderTag(id, options); + if (tag instanceof HTMLElement) { + node.appendChild(tag); + cb(node); + return; + } + } node.append(id); cb(node); return; @@ -413,13 +412,13 @@ defineExpose({ .columnTagCon { position: relative; display: inline-flex; - box-sizing: border-box; - padding: 2px 4px; - max-width: 100%; - background: #d8eeff; - color: #174c76; - border: 1px solid #bbd6ea; - border-radius: 5px; + // box-sizing: border-box; + // padding: 2px 4px; + // max-width: 100%; + // background: #d8eeff; + // color: #174c76; + // border: 1px solid #bbd6ea; + // border-radius: 5px; } .columnTag { position: relative; diff --git a/src/views/demo/signature.vue b/src/views/demo/signature.vue new file mode 100644 index 00000000..c90e2ec8 --- /dev/null +++ b/src/views/demo/signature.vue @@ -0,0 +1,210 @@ + + + diff --git a/src/views/demo/taginput.vue b/src/views/demo/taginput.vue index e4d345b0..ec016847 100644 --- a/src/views/demo/taginput.vue +++ b/src/views/demo/taginput.vue @@ -16,7 +16,7 @@ const renderTag = (id: any, options: any) => { //创建tag元素 const ele = document.createElement("div"); ele.classList.add("tag-demo-con"); - ele.innerHTML = `
${tagName}
`; + ele.innerHTML = `
${tagName}
`; return ele; }; @@ -73,13 +73,25 @@ const onBlur = (): void => { margin: 10px; :deep { .tag-demo-con { - .tag-demo { - padding: 4px; - margin: 4px; - border: 1px solid #ccc; - border-radius: 5px; - line-height: 1em; - min-width: 25px; + .tag-wrap { + height: 25px; + line-height: 25px; + .tag { + display: inline-block; + padding: 2px 8px; + box-sizing: border-box; + border-radius: 16px; + background: #d8eeff; + color: #174c76; + border: 1px solid #bbd6ea; + margin: 0 4px; + } + // padding: 4px; + // margin: 4px; + // border: 1px solid #ccc; + // border-radius: 5px; + // line-height: 1em; + // min-width: 25px; } } }