Compare commits

..

No commits in common. "1df345e01257696dffb362f548ccc0b3a8767d1a" and "5cf8ddeb545e546bab4b496ba72f81a951521b49" have entirely different histories.

4 changed files with 71 additions and 71 deletions

View File

@ -3,7 +3,6 @@ import App from '../src/App.vue'
//基于element组件封装引入element组件库
import { Input } from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(Input);
// 导入组件库

View File

@ -1,75 +1,77 @@
<template>
<el-input
class="w-input"
:style="{ width }"
:value="value"
:size="size"
v-on="inputListeners"
v-bind="[$attrs]"
>
<slot name="append" slot="append" />
<slot name="prefix" slot="prefix" />
<slot name="suffix" slot="suffix" />
<slot name="prepend" slot="prepend" />
</el-input>
</template>
<el-input
class="w-input"
:style="{ width }"
:value="value"
:size="size"
v-on="inputListeners"
v-bind="[$attrs]"
>
<slot name="append" slot="append" />
<slot name="prefix" slot="prefix" />
<slot name="suffix" slot="suffix" />
<slot name="prepend" slot="prepend" />
</el-input>
</template>
<script>
/**
* WInput
* @desc 处理输入的输入框(转大写不能有中文空格等)
*/
export default {
name: "WInput",
props: {
width: {
type: String,
default: "180px",
/**
* WInput
* @desc 处理输入的输入框(转大写不能有中文空格等)
*/
export default {
name: "WInput",
props: {
width: {
type: String,
default: "180px",
},
size: {
type: String,
default: "small",
},
value: {
type: String,
default: "",
},
toUpperCase: {
type: Boolean,
default: true,
},
},
size: {
type: String,
default: "small",
computed: {
//
inputListeners() {
return Object.assign(
{},
//
this.$listeners,
//
//
{
// `v-model`
input: (value) => {
this.$emit("input", this.toUpperCase ? value.toUpperCase() : value);
},
blur: (e) => {
let value = e.target.value
.trim()
.replace(/\s/g, (match) =>
match.charCodeAt(0) === 12288 ? String.fromCharCode(32) : match
);
//
this.$emit("input", value);
},
}
);
},
},
value: {
type: String,
default: "",
mounted() {
// console.warn(this.$route.name);
},
toUpperCase: {
type: Boolean,
default: true,
},
},
computed: {
//
inputListeners() {
return Object.assign(
{},
//
this.$listeners,
//
//
{
// `v-model`
input: (value) => {
this.$emit("input", this.toUpperCase ? value.toUpperCase() : value);
},
blur: (e) => {
let value = e.target.value
.trim()
.replace(/\s/g, (match) =>
match.charCodeAt(0) === 12288 ? String.fromCharCode(32) : match
);
//
this.$emit("input", value);
},
}
);
},
},
mounted() {},
};
</script>
};
</script>
<style lang="scss" scoped></style>

View File

@ -1,6 +1,6 @@
<template>
<div>
<Pedestal ref="ref_Pedestal" v-model="value">
<Pedestal ref="ref_Pedestal" :options="options">
<!-- <template #operate="">
<el-button
class="excel"
@ -22,7 +22,6 @@ export default {
components: { Pedestal },
data() {
return {
value: "",
options: {
fnSearch: this.fnSearch,
formItemAttrs: {

View File

@ -1,4 +1,4 @@
function cloneDeep(obj, hash = new WeakMap()) {
export default function cloneDeep(obj, hash = new WeakMap()) {
if (obj == null || typeof obj !== 'object') return obj
if (obj instanceof Date) return new Date(obj)
if (obj instanceof RegExp) return new RegExp(obj.source, obj.flags)
@ -10,4 +10,4 @@
deepObj[key] = cloneDeep(obj[key], hash)
}
return deepObj
}
}