This commit is contained in:
zyqwst
2020-06-27 22:59:40 +08:00
parent 73068c65cd
commit fdb356484a

View File

@@ -56,7 +56,7 @@
<script> <script>
import TYPE from './type/type' import TYPE from './type/type'
import { Row,Col,Button,Input, Icon,Checkbox,Select,Tooltip } from 'ant-design-vue' import { Row,Col,Button,Input, Icon,Checkbox,Select,Tooltip } from 'ant-design-vue'
import { clearAttr } from './util' // import { clearAttr } from './util'
export default { export default {
name:'JsonSchemaEditor', name:'JsonSchemaEditor',
components: { components: {
@@ -121,11 +121,22 @@ export default {
} }
}, },
methods: { methods: {
onInputName(){ onInputName(e){
clearAttr(this.value) const val = e.target.value
}, console.info('input_name',this.pickKey, val,this.parent)
onInputTitle(event){ // this.$set(this.parent.properties,val,this.pickValue)
this.title = event.target.value // this.$delete(this.parent.properties,this.pickKey)
const p = {};
for(let key in this.parent.properties){
if(key != this.pickKey){
p[key] = this.parent.properties[key]
}else{
p[val] = this.parent.properties[key]
delete this.parent.properties[key]
}
}
console.info(JSON.stringify(p))
this.$set(this.parent,'properties',p)
}, },
onChangeType() { onChangeType() {
this.$delete(this.pickValue,'properties') this.$delete(this.pickValue,'properties')