Commit 50f79195 authored by 周远喜's avatar 周远喜

修改好了

parent 62ea2bf5
...@@ -2,37 +2,37 @@ ...@@ -2,37 +2,37 @@
<template> <template>
<div class="input-code"> <div class="input-code">
<Input v-model="codeValue" clearable required> <Input v-model="codeValue" clearable required>
<Button <Button slot="append" @click="codeClick">生成编号</Button>
slot="append"
@click="codeClick"
>生成编号</Button
>
</Input> </Input>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
export default { export default {
name:"inputCode",
data() { data() {
return { return {
codeValue: "", codeValue: this.value,
select: "", select: "",
}; };
}, },
model: { model: {
prop: "value", prop: "value",
event: "on-change" event: "on-change",
},
props: {
value:[String],
code: {
type: String,
default: "",
}, },
props: { type: {
code:{ type: String,
type:String,
default:""
}, },
type:{
type:String
}
}, },
mounted() { }, mounted() {
// this.codeValue=this.value;
},
methods: { methods: {
// 生成临时编号code // 生成临时编号code
getSerialcode() { getSerialcode() {
...@@ -41,10 +41,7 @@ export default { ...@@ -41,10 +41,7 @@ export default {
}).then((r) => { }).then((r) => {
if (r.result) { if (r.result) {
this.codeValue = r.result[0]; this.codeValue = r.result[0];
this.$emit( this.$emit("on-change", this.codeValue);
"on-change",
this.codeValue
);
} }
}); });
}, },
...@@ -55,7 +52,7 @@ export default { ...@@ -55,7 +52,7 @@ export default {
watch: { watch: {
value(v) { value(v) {
this.codeValue = v; this.codeValue = v;
} },
}, },
}; };
</script> </script>
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
<p> <p>
<Tree :data="result"></Tree> <Tree :data="result"></Tree>
</p> </p>
<p>
<inputCode v-model="data"/>
</p>
</div> </div>
</template> </template>
...@@ -27,6 +30,7 @@ export default { ...@@ -27,6 +30,7 @@ export default {
data() { data() {
return { return {
model: [], model: [],
data:"ddd",
result: [ result: [
{ {
title: "五二九纵", title: "五二九纵",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment